Skip to content

Commit

Permalink
Fix queue not resuming in a timely fashion if PC is put in hibernatio…
Browse files Browse the repository at this point in the history
…n mode
  • Loading branch information
Citrinate committed Jun 11, 2024
1 parent 543a2ec commit 60c0241
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions FreePackages/Handlers/PackageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ internal static async Task OnBotLoggedOn(Bot bot) {
}

await Handlers[bot.BotName].FetchUserData().ConfigureAwait(false);
Handlers[bot.BotName].PackageQueue.Start();
}

private async Task FetchUserData() {
Expand Down
4 changes: 4 additions & 0 deletions FreePackages/Handlers/PackageQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ internal void AddPackages(IEnumerable<Package> packages) {
}
}

internal void Start() {
UpdateTimer(DateTime.Now.AddMinutes(1));
}

private async Task ProcessQueue() {
if (!Bot.IsConnectedAndLoggedOn) {
UpdateTimer(DateTime.Now.AddMinutes(1));
Expand Down

0 comments on commit 60c0241

Please sign in to comment.