From 09caa34d7df17bae40067aa6ccef5cb9fd209c4c Mon Sep 17 00:00:00 2001 From: Matt Isenhower Date: Mon, 7 Sep 2026 17:12:28 -0700 Subject: [PATCH] Clarify Node runner names --- src/app/cron.js | 6 +++--- src/app/index.js | 8 ++++---- src/app/{local.js => node.js} | 18 +++++++++--------- workers/updater/src/updaters.mjs | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) rename src/app/{local.js => node.js} (54%) diff --git a/src/app/cron.js b/src/app/cron.js index 22e0c86..4a64ba2 100644 --- a/src/app/cron.js +++ b/src/app/cron.js @@ -1,14 +1,14 @@ import '../common/bootstrap.js'; import { CronJob } from 'cron'; -import { updateAllLocally, postLocally } from './local.js'; +import { updateAll, sendStatuses } from './node.js'; console.info('Starting periodic tasks...'); // Run every hour at 10sec after the hour new CronJob('10 0 * * * *', async () => { try { - await updateAllLocally(); - await postLocally(); + await updateAll(); + await sendStatuses(); } catch (error) { console.error(error); } diff --git a/src/app/index.js b/src/app/index.js index 8d9bd25..3dbbc2e 100644 --- a/src/app/index.js +++ b/src/app/index.js @@ -1,9 +1,9 @@ import '../common/bootstrap.js'; import { runAction } from '../common/cli.js'; -import { updateAllLocally, postLocally, testScreenshotsLocally } from './local.js'; +import { updateAll, sendStatuses, testScreenshots } from './node.js'; await runAction({ - splatnet: updateAllLocally, - social: postLocally, - socialTest: testScreenshotsLocally, + splatnet: updateAll, + social: sendStatuses, + socialTest: testScreenshots, }, process.argv.slice(2)); diff --git a/src/app/local.js b/src/app/node.js similarity index 54% rename from src/app/local.js rename to src/app/node.js index 7cc8aa8..f5fcb38 100644 --- a/src/app/local.js +++ b/src/app/node.js @@ -1,9 +1,9 @@ -// The local (Node) flavour of running the updaters: filesystem storage in the directories +// Node entry points use filesystem storage in the directories // the site has always been built from. The Worker entry point has its own equivalent over R2. import FilesystemStorage from '../common/storage/FilesystemStorage.js'; -import { updateAll } from './updater/index.js'; -import { sendStatuses, testScreenshots } from './social/index.js'; +import * as updater from './updater/index.js'; +import * as social from './social/index.js'; export function filesystemStorage() { return { @@ -12,20 +12,20 @@ export function filesystemStorage() { }; } -export async function updateAllLocally() { - let updaters = await updateAll(filesystemStorage()); +export async function updateAll() { + let updaters = await updater.updateAll(filesystemStorage()); if (updaters.some(updater => !updater.ok)) throw new Error('One or more updaters failed; social posting skipped.'); return 'Done'; } -export async function postLocally() { - let result = await sendStatuses(filesystemStorage()); +export async function sendStatuses() { + let result = await social.sendStatuses(filesystemStorage()); if (!result.ok) throw new Error('One or more social posts failed.'); return result; } -export function testScreenshotsLocally() { - return testScreenshots(filesystemStorage()); +export function testScreenshots() { + return social.testScreenshots(filesystemStorage()); } diff --git a/workers/updater/src/updaters.mjs b/workers/updater/src/updaters.mjs index 1a806f2..5a8f2ec 100644 --- a/workers/updater/src/updaters.mjs +++ b/workers/updater/src/updaters.mjs @@ -1,5 +1,5 @@ // Runs the shared updaters (src/app/updater) against this Worker's R2 bindings. -// This is the Worker's counterpart of src/app/local.js. +// This is the Worker's counterpart of src/app/node.js. import { BucketStorage } from '../../../src/common/storage/index.js'; import { updateAll } from '../../../src/app/updater/index.js';