fix: implement granular session health detection with SteamAuthError and smart conditional replacement logic
This commit is contained in:
@@ -7,7 +7,7 @@ import axios from 'axios';
|
||||
import fs from 'fs';
|
||||
import { pathToFileURL } from 'url';
|
||||
import { fetchProfileData, scrapeBanStatus } from './services/steam-web';
|
||||
import { scrapeCooldown } from './services/scraper';
|
||||
import { scrapeCooldown, SteamAuthError } from './services/scraper';
|
||||
import { steamClient, LocalSteamAccount } from './services/steam-client';
|
||||
import { BackendService } from './services/backend';
|
||||
|
||||
@@ -247,7 +247,12 @@ const scrapeAccountData = async (account: Account) => {
|
||||
if (backend) await backend.pushCooldown(account.steamId, undefined, now.toISOString());
|
||||
}
|
||||
} catch (e: any) {
|
||||
if (e.message.includes('cookie') || e.message.includes('Sign In')) account.authError = true;
|
||||
if (e instanceof SteamAuthError) {
|
||||
account.authError = true;
|
||||
} else {
|
||||
console.error(`[Scraper] Temporary error for ${account.personaName}: ${e.message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (backend && !account._id.startsWith('shared_')) {
|
||||
|
||||
Reference in New Issue
Block a user