Skip to content

Improvements and fixes#15

Merged
chaqchase merged 3 commits into
mainfrom
feat/improvements-and-fixes
Nov 15, 2025
Merged

Improvements and fixes#15
chaqchase merged 3 commits into
mainfrom
feat/improvements-and-fixes

Conversation

@chaqchase

Copy link
Copy Markdown
Owner

This pull request introduces Cronbake v0.3.2, focusing on improved persistence, error handling, and developer experience. The documentation is significantly expanded and clarified, including new runnable TypeScript examples and guidance for both stateless and persistent job setups. The codebase adds opt-in persistence controls and methods to ensure job restoration is handled predictably, with user-defined jobs overriding restored state and improved metrics for failed executions.

Persistence & Restoration Improvements

  • Persistence is now opt-in per job (persist flag), allowing only selected jobs to be saved/restored, and user-defined jobs replace restored jobs without conflict warnings. Metrics and history are hydrated during restore. [1]], [2]])
  • Added baker.ready() method to await automatic restoration before interacting with jobs; autoStart now waits for persistence to finish. Redundant persistence writes during restore are prevented for faster startups. [1]], [2]])

Error Handling & Metrics

  • Failed job executions now bubble up correctly so metrics/history and lastError reflect failures, and onError handlers fire exactly once. ([CHANGELOG.mdR3-R18])
  • baker.lastExecution() and Cron.time() now match documented API: last actual run timestamp and remaining delay, not current epoch time. [1]], [2]])

Documentation & Examples

  • Major README overhaul: clearer quick-start, advanced persistence usage, explicit opt-in instructions, and copy-paste TypeScript snippets. Added examples/ folder with runnable scripts for stateless and persistent job setups. [1]], [2]], [3]], [4]])
  • Consistent code style in docs and examples (double quotes, explicit flags). [1]], [2]], [3]], [4]], [5]], [6]], [7]], [8]], [9]], [10]], [11]])

API & Metadata Updates

  • NPM metadata updated to point to chaqchase/cronbake. ([CHANGELOG.mdR3-R18])
  • Exports and internal imports updated to support new types and persistence features. [1]], [2]], [3]])

Developer Experience

  • Added guidance and scripts for graceful shutdown, demonstrating how to safely stop jobs and save state on process exit. [1]], [2]], [3]])

Let me know if you want to walk through the new persistence workflow, or try out the example scripts locally!

@chaqchase chaqchase added duplicate This issue or pull request already exists and removed duplicate This issue or pull request already exists labels Nov 15, 2025
@chaqchase chaqchase merged commit c91a906 into main Nov 15, 2025
1 check passed
@chaqchase chaqchase deleted the feat/improvements-and-fixes branch November 15, 2025 04:12
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.

1 participant