Skip to content

Handle blocked cron jobs #9

@joaovictornsv

Description

@joaovictornsv

Blocked cron jobs occur when the finishedAt field is missing in the cron-history collection, often due to unexpected application termination.

Possible solutions:

  • Add event listeners for application termination to handle cleanup, e.g., process.on('SIGTERM', () => { ... }).
    • Note: Not every uncaught exception leads to application termination, so ensure cleanup doesn’t prematurely mark jobs as finished.
  • Implement a mechanism to mark jobs as finished if they exceed a configurable timeout (e.g., X minutes).
    • Optionally, add a new field indicating the job was forcefully finished.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions