Michael Tromba
Michael Tromba

A scheduled restart service for Railway deployments

Open-source watchdog that restarts your Railway services on a cron schedule. Built to work around a Bun runtime memory leak.

A scheduled restart service for Railway deployments

I was running two services for UX Canvas on Railway — a builder service and an agent service, both on the Bun runtime. I noticed memory usage creeping up over days. After digging into it with an AI agent, we determined it was a known issue in Bun itself, not something in my codebase. The kind of leak you can't fix from your side.

The 80/20 answer was obvious: just restart the services on a schedule. Railway doesn't have a built-in way to do this, and the existing community solutions were sparse. It was simple enough to build my own, so I did — Railway Service Watchdog is about 180 lines of TypeScript that calls Railway's GraphQL API on a cron schedule to restart one or more services automatically.

I had Opus 4.6 write the prompt, plugged it into a fresh Cursor instance, iterated a couple times, and it was done. Packaged it up as a Railway template so anyone can deploy it with one click. It restarts my UX Canvas services every Sunday night at 4 AM, and I haven't thought about the memory leak since.