Skip to content

Commit dc4df94

Browse files
committed
Merge branch 'disable-schema-auto-update' into refactorx
2 parents e5fa43e + 1ec770e commit dc4df94

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/classes/DiscordWebhook/pricelistUpdate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,7 +2044,7 @@ class PriceUpdateQueue {
20442044
this.url = url;
20452045
}
20462046

2047-
private static sleepTime = 1000;
2047+
private static sleepTime = 1500;
20482048

20492049
private static isRateLimited = false;
20502050

@@ -2080,7 +2080,7 @@ class PriceUpdateQueue {
20802080
await timersPromises.setTimeout(this.sleepTime);
20812081

20822082
if (this.isRateLimited) {
2083-
this.sleepTime = 1000;
2083+
this.sleepTime = 1500;
20842084
this.isRateLimited = false;
20852085
}
20862086

@@ -2091,7 +2091,7 @@ class PriceUpdateQueue {
20912091

20922092
if (e?.err?.status === 429) {
20932093
const retryAfter = (e.err.data as WebhookErrorData)?.retry_after;
2094-
this.sleepTime = typeof retryAfter === 'number' ? Math.ceil(retryAfter * 1000) : 3000;
2094+
this.sleepTime = typeof retryAfter === 'number' ? retryAfter * 1000 + 100 : 3000;
20952095
this.isRateLimited = true;
20962096
}
20972097
})

src/classes/DiscordWebhook/pricelistUpdateFailed.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class PriceUpdateFailedQueue {
5151
this.url = url;
5252
}
5353

54-
private static sleepTime = 1000;
54+
private static sleepTime = 1500;
5555

5656
private static isRateLimited = false;
5757

@@ -87,7 +87,7 @@ class PriceUpdateFailedQueue {
8787
await timersPromises.setTimeout(this.sleepTime);
8888

8989
if (this.isRateLimited) {
90-
this.sleepTime = 1000;
90+
this.sleepTime = 1500;
9191
this.isRateLimited = false;
9292
}
9393

@@ -97,7 +97,7 @@ class PriceUpdateFailedQueue {
9797
log.warn(`❌ Failed to send price update error for ${sku} to Discord: `, e.err);
9898
if (e?.err?.status === 429) {
9999
const retryAfter = (e.err.data as WebhookErrorData)?.retry_after;
100-
this.sleepTime = typeof retryAfter === 'number' ? Math.ceil(retryAfter * 1000) : 3000;
100+
this.sleepTime = typeof retryAfter === 'number' ? retryAfter * 1000 + 100 : 3000;
101101
this.isRateLimited = true;
102102
}
103103
})

src/classes/DiscordWebhook/sendAlert.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ interface Alert {
332332
class AlertQueue {
333333
private static alerts: Alert[] = [];
334334

335-
private static sleepTime = 1000;
335+
private static sleepTime = 1500;
336336

337337
private static isRateLimited = false;
338338

@@ -360,7 +360,7 @@ class AlertQueue {
360360
await timersPromises.setTimeout(this.sleepTime);
361361

362362
if (this.isRateLimited) {
363-
this.sleepTime = 1000;
363+
this.sleepTime = 1500;
364364
this.isRateLimited = false;
365365
}
366366

@@ -369,7 +369,7 @@ class AlertQueue {
369369
.catch((e: WebhookError) => {
370370
if (e.err.status === 429) {
371371
const retryAfter = (e.err.data as WebhookErrorData)?.retry_after;
372-
this.sleepTime = typeof retryAfter === 'number' ? Math.ceil(retryAfter * 1000) : 3000;
372+
this.sleepTime = typeof retryAfter === 'number' ? retryAfter * 1000 + 100 : 3000;
373373
this.isRateLimited = true;
374374
}
375375
})
@@ -383,7 +383,7 @@ class AlertQueue {
383383
class AlertPpuQueue {
384384
private static alerts: Alert[] = [];
385385

386-
private static sleepTime = 1000;
386+
private static sleepTime = 1500;
387387

388388
private static isRateLimited = false;
389389

@@ -411,7 +411,7 @@ class AlertPpuQueue {
411411
await timersPromises.setTimeout(this.sleepTime);
412412

413413
if (this.isRateLimited) {
414-
this.sleepTime = 1000;
414+
this.sleepTime = 1500;
415415
this.isRateLimited = false;
416416
}
417417

@@ -421,7 +421,7 @@ class AlertPpuQueue {
421421
if (e.err.status === 429) {
422422
log.warn(`❌ Failed to send alert to Discord: `, e.err);
423423
const retryAfter = (e.err.data as WebhookErrorData)?.retry_after;
424-
this.sleepTime = typeof retryAfter === 'number' ? Math.ceil(retryAfter * 1000) : 3000;
424+
this.sleepTime = typeof retryAfter === 'number' ? retryAfter * 1000 + 100 : 3000;
425425
this.isRateLimited = true;
426426
}
427427
})

0 commit comments

Comments
 (0)