Skip to content

Commit

Permalink
Merge pull request #32 from Sadzurami/fix/update-sendTradeOfferPolicy
Browse files Browse the repository at this point in the history
Fix/update-sendTradeOfferPolicy
  • Loading branch information
yakikotori authored Aug 10, 2023
2 parents c0d1444 + b5d86c7 commit 8feee68
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion BotLooter/Looting/LootClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ public LootClient(SteamAccountCredentials credentials, SteamUserSession steamSes
_steamWeb = steamWeb;

_sendTradeOfferPolicy = Policy
.HandleResult<RestResponse<SendTradeOfferResponse>>(res => res.StatusCode == HttpStatusCode.InternalServerError)
.HandleResult<RestResponse<SendTradeOfferResponse>>(res => {
if (res.StatusCode != HttpStatusCode.InternalServerError) {
return false;
}

return res.Content?.ToLower().Contains("please try again later") ?? false;
})
.WaitAndRetryAsync(3, _ => TimeSpan.FromSeconds(10));
}

Expand Down

0 comments on commit 8feee68

Please sign in to comment.