fix: implement robust multi-timestamp synchronization logic to prevent data regression
This commit is contained in:
@@ -62,18 +62,22 @@ export class BackendService {
|
||||
loginName: account.loginName,
|
||||
steamLoginSecure: account.steamLoginSecure,
|
||||
loginConfig: account.loginConfig,
|
||||
sessionUpdatedAt: account.sessionUpdatedAt
|
||||
sessionUpdatedAt: account.sessionUpdatedAt,
|
||||
lastMetadataCheck: account.lastBanCheck,
|
||||
lastScrapeTime: account.lastScrapeTime,
|
||||
cooldownExpiresAt: account.cooldownExpiresAt
|
||||
}, { headers: this.headers });
|
||||
} catch (e) {
|
||||
console.error('[Backend] Failed to share account');
|
||||
}
|
||||
}
|
||||
|
||||
public async pushCooldown(steamId: string, cooldownExpiresAt?: string) {
|
||||
public async pushCooldown(steamId: string, cooldownExpiresAt?: string, lastScrapeTime?: string) {
|
||||
if (!this.token) return;
|
||||
try {
|
||||
await axios.patch(`${this.url}/api/sync/${steamId}/cooldown`, {
|
||||
cooldownExpiresAt
|
||||
cooldownExpiresAt,
|
||||
lastScrapeTime
|
||||
}, { headers: this.headers });
|
||||
} catch (e) {
|
||||
console.error(`[Backend] Failed to push cooldown for ${steamId}`);
|
||||
|
||||
Reference in New Issue
Block a user