Skip to content

Commit

Permalink
fix: Give duels watcher and collection loading extra time to complete
Browse files Browse the repository at this point in the history
  • Loading branch information
joolean committed Sep 1, 2023
1 parent 2336372 commit 0d04308
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
7 changes: 6 additions & 1 deletion HearthWatcher/PVPDungeonRunWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ public bool Update()

public bool UpdatePVPDungeonInfo()
{
var pvpDungeonInfo = Reflection.Client.GetPVPDungeonInfo();
DungeonInfo pvpDungeonInfo = null;
using(_ = Reflection.ClientReadTimeout(10000))
{
pvpDungeonInfo = Reflection.Client.GetPVPDungeonInfo();
}

if(pvpDungeonInfo != null)
{
if(pvpDungeonInfo.RunActive)
Expand Down
13 changes: 9 additions & 4 deletions Hearthstone Deck Tracker/Hearthstone/CollectionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ public static class CollectionHelpers

private static async Task<Collection?> LoadCollection(Key key)
{
var data = await Task.Run(() => new
{
Collection = Reflection.Client.GetFullCollection(),
BattleTag = Reflection.Client.GetBattleTag()
var data = await Task.Run(() => {
using(_ = Reflection.ClientReadTimeout(10000))
{
return new
{
Collection = Reflection.Client.GetFullCollection(),
BattleTag = Reflection.Client.GetBattleTag()
};
}
});
if(data.Collection?.Cards.Any() ?? false)
{
Expand Down

0 comments on commit 0d04308

Please sign in to comment.