Use a PID lock file instead of making the wait executable go by the process name to allow for multiple bots on a single machine
This commit is contained in:
parent
4882732b7f
commit
f015c79b75
2 changed files with 4 additions and 2 deletions
|
@ -46,6 +46,7 @@ namespace Bot
|
|||
|
||||
public static unsafe void Main(string[] args)
|
||||
{
|
||||
File.WriteAllText("PID.lock", Process.GetCurrentProcess().Id.ToString());
|
||||
Console.WriteLine("Setting up Main Configuration");
|
||||
Log = new Logger("BotCore5");
|
||||
BotSession.Instance.Logger = Log;
|
||||
|
@ -497,6 +498,7 @@ namespace Bot
|
|||
AutoResetEvent are = new AutoResetEvent(false);
|
||||
are.WaitOne(TimeSpan.FromMinutes(5));
|
||||
}
|
||||
File.Delete("PID.lock");
|
||||
Environment.Exit(0);
|
||||
|
||||
//System.Console.WriteLine("PAUSING. PRESS ANY KEY TO EXIT");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue