Update bot to remove lockfile on exit
This commit is contained in:
parent
43a87c6be0
commit
f1c8372f8b
1 changed files with 7 additions and 1 deletions
|
@ -61,7 +61,7 @@ namespace Bot
|
||||||
MainConfiguration.Instance.Load();
|
MainConfiguration.Instance.Load();
|
||||||
MainConfiguration conf = MainConfiguration.Instance;
|
MainConfiguration conf = MainConfiguration.Instance;
|
||||||
//MasterObjectCaches = ObjectCaches.Instance;
|
//MasterObjectCaches = ObjectCaches.Instance;
|
||||||
|
AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
|
||||||
|
|
||||||
if (args.Length == 2)
|
if (args.Length == 2)
|
||||||
{
|
{
|
||||||
|
@ -594,6 +594,12 @@ namespace Bot
|
||||||
//System.Console.ReadKey();
|
//System.Console.ReadKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void CurrentDomain_ProcessExit(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Exit the process
|
||||||
|
if (File.Exists("Bot.lockfile")) File.Delete("Bot.lockfile");
|
||||||
|
}
|
||||||
|
|
||||||
private static void onJoinGroupChat(object sender, GroupChatJoinedEventArgs e)
|
private static void onJoinGroupChat(object sender, GroupChatJoinedEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Success)
|
if (e.Success)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue