Skip to content

Commit

Permalink
Fix Emoji List Race Condition (#42)
Browse files Browse the repository at this point in the history
* Fix emoji list race condition upon startup

* Oops

* Hopefully it works 🤷 😂 🎃
  • Loading branch information
versx authored Oct 29, 2020
1 parent 4f8cf64 commit cef3d96
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ public async Task Start()
_whm.QuestSubscriptionTriggered += OnQuestSubscriptionTriggered;
_whm.InvasionSubscriptionTriggered += OnInvasionSubscriptionTriggered;
}
_whm.Start();

_logger.Info("WebhookManager is running...");
}
Expand Down Expand Up @@ -288,6 +289,7 @@ public async Task Stop()
_whm.QuestSubscriptionTriggered -= OnQuestSubscriptionTriggered;
_whm.InvasionSubscriptionTriggered -= OnInvasionSubscriptionTriggered;
}
_whm.Stop();

_logger.Info("WebhookManager is stopped...");
}
Expand Down
15 changes: 14 additions & 1 deletion src/Net/Webhooks/WebhookController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,26 @@ public WebhookController(WhConfig config)
_http.GymDetailsReceived += Http_GymDetailsReceived;
_http.WeatherReceived += Http_WeatherReceived;
_http.IsDebug = _config.Debug;
_http.Start();

new System.Threading.Thread(LoadAlarmsOnChange).Start();
}

#endregion

#region Public Methods

public void Start()
{
_http?.Start();
}

public void Stop()
{
_http?.Stop();
}

#endregion

#region HttpServer Events

private void Http_PokemonReceived(object sender, DataReceivedEventArgs<PokemonData> e)
Expand Down

0 comments on commit cef3d96

Please sign in to comment.