Skip to content

Commit

Permalink
chore(plugin-server): squelch annoying shutdown error
Browse files Browse the repository at this point in the history
  • Loading branch information
bretthoerner committed Oct 5, 2023
1 parent 8e754e4 commit 1cb2518
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion plugin-server/src/worker/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,21 @@ export async function createWorker(config: PluginsServerConfig, hub: Hub): Promi

for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
if (updateJob) {
process.on(signal, updateJob.cancel)
process.on(signal, () => {
try {
updateJob.cancel()
} catch (err) {
if (
err instanceof TypeError &&
err.message.includes("Cannot read properties of undefined (reading 'length')")
) {
// Ignore the annoying error node-schedule throws
return
}

throw err
}
})
}
}

Expand Down

0 comments on commit 1cb2518

Please sign in to comment.