mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-11-18 16:58:18 -06:00
Both Workers and their Durable Objects are wrapped with @sentry/cloudflare, so the shared code's @sentry/core calls (failed updaters, social posts, archive snapshots) reach Sentry. A lane run that fails outright, a failed credential renewal and a failed archive compression are reported too. Durable Object RPC methods use instrumentPrototypeMethods; without it they run with no Sentry client and their events are dropped. The Node runner and the compressor's container no longer use Sentry; @sentry/node is gone. POST /sentry-test sends one test event from the updater Worker and one from a Durable Object. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
929 B
JavaScript
25 lines
929 B
JavaScript
// Container entry point: compress finished days in the archive Space into daily tar.zst files,
|
|
// then exit. The Compressor Durable Object starts it and reads the exit code.
|
|
//
|
|
// Environment: AWS_S3_ENDPOINT, AWS_REGION, AWS_S3_ARCHIVE_BUCKET, AWS_ACCESS_KEY_ID and
|
|
// AWS_SECRET_ACCESS_KEY (see ArchiveCompressor), MAX_DAYS, DRY_RUN, and LOG_PORT (where the
|
|
// Durable Object fetches what this prints). A failure is reported to Sentry by the Durable
|
|
// Object, from the exit code.
|
|
|
|
import { compressArchives } from '../../../app/data/ArchiveCompressor.mjs';
|
|
import { serveLogs } from './logServer.mjs';
|
|
|
|
let logs = serveLogs(process.env.LOG_PORT);
|
|
|
|
let maxDays = Number(process.env.MAX_DAYS || 10);
|
|
let dryRun = process.env.DRY_RUN === 'true';
|
|
|
|
try {
|
|
// The compressor logs its own errors.
|
|
await compressArchives(maxDays, dryRun);
|
|
} catch {
|
|
process.exitCode = 1;
|
|
} finally {
|
|
await logs.close(process.exitCode ?? 0);
|
|
}
|