diff --git a/plugin-server/src/worker/worker.ts b/plugin-server/src/worker/worker.ts index 02f3dc92754bc..71e6c75f91ec3 100644 --- a/plugin-server/src/worker/worker.ts +++ b/plugin-server/src/worker/worker.ts @@ -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 + } + }) } }