1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-07-31 01:59:03 +02:00

Increase process close timeouts to 20 seconds from 10

This commit is contained in:
chylex 2016-09-18 21:49:41 +02:00
parent c38d507e50
commit 7388eb07ca

View File

@ -71,11 +71,11 @@ private static void Main(){
string[] programArguments = Environment.GetCommandLineArgs();
if (programArguments.Contains("-restart")){
for(int attempt = 0; attempt < 21; attempt++){
for(int attempt = 0; attempt < 41; attempt++){
if (LockManager.Lock()){
break;
}
else if (attempt == 20){
else if (attempt == 40){
MessageBox.Show(BrandName+" is taking too long to close, please wait and then start the application again manually.", BrandName+" Cannot Restart", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
@ -91,7 +91,7 @@ private static void Main(){
return;
}
else if (MessageBox.Show("Another instance of "+BrandName+" is already running.\r\nDo you want to close it?", BrandName+" is Already Running", MessageBoxButtons.YesNo, MessageBoxIcon.Error, MessageBoxDefaultButton.Button2) == DialogResult.Yes){
if (!LockManager.CloseLockingProcess(10000)){
if (!LockManager.CloseLockingProcess(20000)){
MessageBox.Show("Could not close the other process.", BrandName+" Has Failed :(", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}