Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cron): prevent duplicate executions and enhance type safety #690

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

juddisjudd
Copy link
Member

@juddisjudd juddisjudd commented Jan 18, 2025

This PR addresses two key issues with the cron implementation:

  1. Fixed unintentional duplicate executions by:

    • Adding lastRun timestamp tracking for each task
    • Adding a 60-second cooldown check between executions
    • Adding debug logging for prevented duplicates
  2. Enhanced type safety and validation:

    • Added proper type annotations for special cron expressions (like 'L' for last day)
    • Added support for named day/month formats (mon-fri, jan,dec)
    • Improved validation for ranges and step values
    • Enhanced error messages for invalid expressions

@thelindat thelindat merged commit cb6792e into overextended:master Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants