@stonyx/cron 0.2.1-alpha.30 → 0.2.1-alpha.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/service.js +13 -4
- package/package.json +1 -1
package/dist/service.js
CHANGED
|
@@ -237,12 +237,21 @@ export default class CronService {
|
|
|
237
237
|
// heap - and only its own settle releases it, so aborting here would
|
|
238
238
|
// strand every sibling permanently un-due.
|
|
239
239
|
//
|
|
240
|
+
// Reported on an UNGATED channel. `this.log()` returns early when
|
|
241
|
+
// `config.cron.log` is false - a supported production setting - and a
|
|
242
|
+
// failure here permanently unschedules the job while `status()` keeps
|
|
243
|
+
// reporting the service healthy. Silent-and-healthy is the failure
|
|
244
|
+
// class the phase split exists to remove, so the one handler that
|
|
245
|
+
// survives it must not depend on a log flag. `log.error` is a Stonyx
|
|
246
|
+
// system log type, created in the Log constructor rather than by
|
|
247
|
+
// `defineType`, so it is always callable and never gated.
|
|
248
|
+
//
|
|
240
249
|
// This is the outermost handler on the timer path, so it is the one
|
|
241
|
-
// that must not be able to throw. `log
|
|
242
|
-
// can reach
|
|
243
|
-
// rather than being allowed to take the batch down.
|
|
250
|
+
// that must not be able to throw. `log` is a shared singleton whose
|
|
251
|
+
// transports can reach the filesystem, so its own failure is
|
|
252
|
+
// swallowed here rather than being allowed to take the batch down.
|
|
244
253
|
try {
|
|
245
|
-
|
|
254
|
+
log.error(`Cron — Job "${job.name}" (${job.id}) execution failed unexpectedly: ${describeError(err)}`);
|
|
246
255
|
}
|
|
247
256
|
catch {
|
|
248
257
|
// Nothing left to report to.
|