Skip to content

Commit

Permalink
fix autobump when bptf down?
Browse files Browse the repository at this point in the history
  • Loading branch information
idinium96 committed Jul 29, 2020
1 parent be9ef0f commit 0ebdc0f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/classes/Listings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export = class Listings {

private autoRelistEnabled = false;

private autoRelistRetry = false;

private autoRelistTimeout;

private templates: { buy: string; sell: string } = {
Expand Down Expand Up @@ -97,6 +99,8 @@ export = class Listings {
this.getAccountInfo().asCallback((err, info) => {
if (err) {
log.warn('Failed to get account info from backpack.tf: ', err);
clearTimeout(this.autoRelistTimeout);
this.autoRelistRetry = true;
return;
}

Expand All @@ -108,6 +112,9 @@ export = class Listings {
'Enabling autorelist! - Consider paying for backpack.tf premium instead of forcefully bumping listings: https://backpack.tf/donate'
);
this.enableAutoRelist();
} else if (this.autoRelistRetry) {
this.autoRelistRetry = false;
this.enableAutoRelist();
}
});
}
Expand Down

0 comments on commit 0ebdc0f

Please sign in to comment.