diff --git a/lib/zinnia.js b/lib/zinnia.js index 4b15cec1..a6db14f4 100644 --- a/lib/zinnia.js +++ b/lib/zinnia.js @@ -280,6 +280,11 @@ export async function run ({ type: 'error', message: `${capitalize(module)} has been inactive for 5 minutes, restarting...` }) + + const err = new Error('Module inactive for 5 minutes') + Object.assign(err, { module }) + maybeReportErrorToSentry(err) + controller.abort() }, 5 * 60 * 1000) } @@ -319,8 +324,12 @@ export async function run ({ ]) console.error('Zinnia main loop ended') } catch (err) { - console.error('Zinnia main loop errored', err) - maybeReportErrorToSentry(err) + if (err.name === 'AbortError') { + console.error('Zinnia main loop aborted') + } else { + console.error('Zinnia main loop errored', err) + maybeReportErrorToSentry(err) + } } finally { controller.abort() }