Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default class FMarketLowestPrice extends Feature<CMarketHome> {

private _loadedMarketPrices: Record<string, string> = {};
private _delayMs = 2000; // Delay to put between requests in attempt to avoid 429s
private _delayTimeoutMs = 60000; // Time to wait for rate limit reset
private _delay = false; // Whether to put a delay between requests
private _timeout = false; // Whether the user has been timed-out

Expand Down Expand Up @@ -109,12 +110,13 @@ export default class FMarketLowestPrice extends Feature<CMarketHome> {

let data = this._loadedMarketPrices[marketHashName];
if (typeof data === "undefined") {
if (this._timeout) {
this._insertPrice(node, "timeout");
continue;
data = await this._getPriceOverview(Number(appid), marketHashName);

while (data == "timeout") {
await TimeUtils.timer(this._delayTimeoutMs);
data = await this._getPriceOverview(Number(appid), marketHashName);
}

data = await this._getPriceOverview(Number(appid), marketHashName);
this._delay = true;
}

Expand Down