mirror of
https://github.com/linkwarden/linkwarden.git
synced 2026-06-28 14:55:49 +00:00
17 lines
364 B
TypeScript
17 lines
364 B
TypeScript
import { spawn } from "node:child_process";
|
||
|
||
function launch() {
|
||
const child = spawn("tsx", ["worker.ts"], { stdio: "inherit" });
|
||
|
||
child.on("exit", (code, signal) => {
|
||
console.error(
|
||
`worker exited (code=${code} signal=${signal}) – restarting…`
|
||
);
|
||
setTimeout(launch, 5000);
|
||
});
|
||
}
|
||
|
||
process.on("SIGINT", () => process.exit());
|
||
|
||
launch();
|