Skip to content

Commit

Permalink
Add save functions to task list
Browse files Browse the repository at this point in the history
  • Loading branch information
U-lis committed Jul 9, 2024
1 parent 644930f commit 6f53ca5
Showing 1 changed file with 50 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,59 @@ public partial class RenderSubscriber

private void StoreAdventureBossList()
{
Task.Run(async () =>
try
{
var tasks = new List<Task>();
Log.Information("[Adventure Boss] Store adventure boss list");

Log.Information($"[Adventure Boss] {_adventureBossSeasonList.Count} Season");
await MySqlStore.StoreAdventureBossSeasonList(_adventureBossSeasonList);
Log.Information($"[Adventure Boss] {_adventureBossWantedList.Count} Wanted");
await MySqlStore.StoreAdventureBossWantedList(_adventureBossWantedList);
Log.Information($"[Adventure Boss] {_adventureBossChallengeList.Count} Challenge");
await MySqlStore.StoreAdventureBossChallengeList(_adventureBossChallengeList);
Log.Information($"[Adventure Boss] {_adventureBossRushList.Count} Rush");
await MySqlStore.StoreAdventureBossRushList(_adventureBossRushList);
Log.Information($"[Adventure Boss] {_adventureBossUnlockFloorList.Count} Unlock");
await MySqlStore.StoreAdventureBossUnlockFloorList(_adventureBossUnlockFloorList);
Log.Information($"[Adventure Boss] {_adventureBossClaimRewardList.Count} claim");
await MySqlStore.StoreAdventureBossClaimRewardList(_adventureBossClaimRewardList);
});
tasks.Add(Task.Run(async () =>
{
Log.Information($"[Adventure Boss] {_adventureBossSeasonList.Count} Season");
await MySqlStore.StoreAdventureBossSeasonList(_adventureBossSeasonList);
}
));

tasks.Add(Task.Run(async () =>
{
Log.Information($"[Adventure Boss] {_adventureBossWantedList.Count} Wanted");
await MySqlStore.StoreAdventureBossWantedList(_adventureBossWantedList);
}
));

tasks.Add(Task.Run(async () =>
{
Log.Information($"[Adventure Boss] {_adventureBossChallengeList.Count} Challenge");
await MySqlStore.StoreAdventureBossChallengeList(_adventureBossChallengeList);
}
));

tasks.Add(Task.Run(async () =>
{
Log.Information($"[Adventure Boss] {_adventureBossRushList.Count} Rush");
await MySqlStore.StoreAdventureBossRushList(_adventureBossRushList);
}
));

tasks.Add(Task.Run(async () =>
{
Log.Information($"[Adventure Boss] {_adventureBossUnlockFloorList.Count} Unlock");
await MySqlStore.StoreAdventureBossUnlockFloorList(_adventureBossUnlockFloorList);
}
));

tasks.Add(Task.Run(async () =>
{
Log.Information($"[Adventure Boss] {_adventureBossClaimRewardList.Count} claim");
await MySqlStore.StoreAdventureBossClaimRewardList(_adventureBossClaimRewardList);
}
));

Task.WaitAll(tasks.ToArray());
}
catch (Exception e)
{
Log.Error(e.Message);
}
}

private void ClearAdventureBossList()
Expand Down

0 comments on commit 6f53ca5

Please sign in to comment.