@stonyx/cron 0.2.1-alpha.25 → 0.2.1-alpha.26
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 +6 -0
- package/package.json +1 -1
package/dist/service.js
CHANGED
|
@@ -311,6 +311,12 @@ export default class CronService {
|
|
|
311
311
|
// already happened. Identity, not id, so a removed-then-replaced key is
|
|
312
312
|
// caught too. Deliberately synchronous with the `onJobDue` call below -
|
|
313
313
|
// nothing can interleave between this check and the invocation.
|
|
314
|
+
//
|
|
315
|
+
// Returning here without a settle is NOT the claim-without-settle hazard
|
|
316
|
+
// the try/finally below exists for: the job is already out of `this.jobs`,
|
|
317
|
+
// so the object holding `runningAtMs` is unreachable, its heap entry was
|
|
318
|
+
// removed by `remove()`, and re-inserting or run-logging it is exactly the
|
|
319
|
+
// resurrection `settleJob`'s identity guard refuses.
|
|
314
320
|
if (this.jobs.get(job.id) !== job)
|
|
315
321
|
return { status: 'skipped', reason: 'removed' };
|
|
316
322
|
const startMs = Date.now();
|