Commit
Enhance worker functionality with health checks and job recovery features
Commit details
Commit notes
This commit introduces several improvements to the worker module, including:
- **Health Check Endpoint:** Added a new HTTP endpoint (`/health`) to monitor the worker's status and health. - **Graceful Shutdown:** Implemented a mechanism for graceful shutdown, allowing the worker to finish processing current jobs before stopping. - **Heartbeat Mechanism:** Introduced a heartbeat-based lock extension for long-running jobs to prevent job timeouts. - **Automatic Stalled Job Recovery:** Enhanced job recovery capabilities to automatically handle stalled jobs, ensuring they are re-queued or marked as dead if necessary.
Additionally, various code refactorings were made for consistency and clarity, including updates to import statements and logging improvements.
- Files changed
- 5
- Lines added
- +1,591
- Lines removed
- −370