Slow PoE2 poller to 1 hour — matches poe.ninja's own refresh rate
poe.ninja's overview data doesn't update faster than hourly, so polling every 15 minutes was just re-fetching the same numbers. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014c1L8ghNBFjfiH64UMViP8
This commit is contained in:
@@ -306,7 +306,7 @@ export async function registerAdminRoutes(app: FastifyInstance) {
|
||||
{ currencyId: base.currencyId, name: base.name, icon: base.icon ?? null },
|
||||
{ currencyId: quote.currencyId, name: quote.name, icon: quote.icon ?? null }
|
||||
);
|
||||
// Poll immediately rather than waiting for the next tick (up to 15 minutes) — cheap,
|
||||
// Poll immediately rather than waiting for the next tick (up to 1 hour) — cheap,
|
||||
// and refreshes every existing entry's rate too.
|
||||
pollPoe2Now().catch((err) => logger.error('poe2', `Immediate poll failed: ${err.message}`));
|
||||
return reply.code(201).send(created);
|
||||
|
||||
@@ -14,7 +14,7 @@ const SYNTHESIS_TICK_MS = 60_000;
|
||||
const RETENTION_TICK_MS = 60 * 60_000; // hourly
|
||||
const WEATHER_TICK_MS = 45 * 60_000;
|
||||
const STOCKS_TICK_MS = 15 * 60_000; // per admin spec — stock prices move faster than weather
|
||||
const POE2_TICK_MS = 15 * 60_000; // matches Stocks' cadence
|
||||
const POE2_TICK_MS = 60 * 60_000; // poe.ninja's own overview data doesn't refresh faster than hourly, so polling more often than this just re-fetches the same numbers
|
||||
|
||||
export function startScheduler() {
|
||||
const provider = () => {
|
||||
@@ -67,9 +67,9 @@ export function startScheduler() {
|
||||
}
|
||||
}, RETENTION_TICK_MS);
|
||||
|
||||
// Immediate first call for both — unlike RSS sources (whose "due" check makes a
|
||||
// brand-new source eligible on the very next 1-minute tick), weather/stocks have no
|
||||
// such shortcut; without this the sidebar is empty for up to 45/15 minutes after
|
||||
// Immediate first call for all three — unlike RSS sources (whose "due" check makes a
|
||||
// brand-new source eligible on the very next 1-minute tick), weather/stocks/poe2 have
|
||||
// no such shortcut; without this the sidebar is empty for up to 45/15/60 minutes after
|
||||
// every restart.
|
||||
pollWeatherNow().catch((err) => logger.error('weather', `Initial poll failed: ${err.message}`));
|
||||
setInterval(() => {
|
||||
@@ -86,5 +86,5 @@ export function startScheduler() {
|
||||
pollPoe2Now().catch((err) => logger.error('poe2', `Poll tick failed: ${err.message}`));
|
||||
}, POE2_TICK_MS);
|
||||
|
||||
logger.info('scheduler', 'Started: poll every 1m, synthesis every 1m, retention every 1h, weather every 45m, stocks every 15m, poe2 every 15m');
|
||||
logger.info('scheduler', 'Started: poll every 1m, synthesis every 1m, retention every 1h, weather every 45m, stocks every 15m, poe2 every 1h');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user