Skip to content

Commit

Permalink
add timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
idinium96 committed Jul 29, 2020
1 parent 0ebdc0f commit cb0dcca
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/classes/Listings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export = class Listings {

private autoRelistRetry = false;

private autoRelistRetryTimeout;

private autoRelistTimeout;

private templates: { buy: string; sell: string } = {
Expand Down Expand Up @@ -112,9 +114,13 @@ 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) {
} else if (this.autoRelistEnabled && this.autoRelistRetry) {
this.autoRelistRetry = false;
this.enableAutoRelist();
clearTimeout(this.autoRelistRetryTimeout);
log.warn('backpack.tf down, will wait for 30 minutes before relist again...');
this.autoRelistRetryTimeout = setTimeout(() => {
this.enableAutoRelist();
}, 30 * 60 * 1000);
}
});
}
Expand Down

0 comments on commit cb0dcca

Please sign in to comment.