Skip to content

The standalone worker entry gets the watchdogs, and can finally build - #81

Merged
ralyodio merged 1 commit into
mainfrom
worktree-worker-watchdog
Sep 22, 2026
Merged

ralyodio merged 1 commit into
mainfrom
worktree-worker-watchdog

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

apps/worker/src/main.js is the entry for splitting workers onto their own service. It had
no watchdog, because the one added in #79 went into the combined entry next door and #80
moved that to the package.

Why the worker is the case that most needs it

A worker has less to show for a wedge than a web process, not more. There is no page to
hang, so a worker stuck on a client simply stops doing the work and nothing anywhere goes
red. This entry answers no requests at all, so there is not even a slow page for somebody to
notice. The three outages behind all of this were only caught because a human loaded the
site.

const watchdogs = watchDependencies({
  postgres: () => healthcheck(),
  redis: () => connection.ping(),
});

Same two probes, same shared sql handle and shared connection, same package, same
timings. stop() runs first on SIGTERM so a clean drain is not read as a wedge.

It has never been able to build

Found while wiring it. This file imports configurePayments from @tipoff/payments, and
apps/worker/package.json does not declare it:

$ bun build apps/worker/src/main.js --target=bun
error: Could not resolve: "@tipoff/payments"

That reproduces on unmodified origin/main, so it is pre-existing and not from this change
(verified by stashing this diff and rebuilding). The comment at the top of the file promises
that splitting the workers off is a Railway variable change and a different start command
"with no code to rewrite" — in fact it would have failed at import.

One line added to apps/worker/package.json, and the entry builds for the first time
(2.15 MB bundle). Nothing deployed runs this entry today: the live services run
apps/web/src/main.js with ROLES, so this is a latent defect rather than an outage.

Testing

bun build apps/worker/src/main.js now resolves and bundles. biome check clean. 25 pass /
0 fail on config and nichedb-plays. The package itself carries the watchdog's own 19 tests.

Same change is going to genrewatch and watchnews; genrewatch already declares its payments
package, so only the watchdog part applies there.

🤖 Generated with Claude Code

apps/worker/src/main.js is the entry for splitting workers onto their own
service. It had no watchdog, because the one added yesterday went into the
combined entry next door.

A worker has less to show for a wedge than a web process does, not more. There
is no page to hang, so a worker stuck on a client simply stops doing the work and
nothing anywhere goes red; this entry answers no requests at all, so there is not
even a slow page for somebody to notice. That is the case the watchdog is most
worth having, and it was the one place without it.

While wiring it: this file has never been able to build. It imports
configurePayments from @tipoff/payments and apps/worker/package.json does not
declare it, so `bun build apps/worker/src/main.js` fails to resolve on origin/main
too, unchanged. The comment at the top promises that splitting the workers off is
a Railway variable change and a different start command "with no code to rewrite",
and it would have failed at import instead. One line, and the entry builds for the
first time.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 598c3df into main Sep 22, 2026
2 checks passed
@ralyodio
ralyodio deleted the worktree-worker-watchdog branch September 22, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant