Skip to content

Commit c91a906

Browse files
authored
Merge pull request #15 from chaqchase/feat/improvements-and-fixes
Improvements and fixes
2 parents 835776c + cbb6b66 commit c91a906

File tree

15 files changed

+666
-178
lines changed

15 files changed

+666
-178
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,9 @@ dist
170170

171171
node_modules
172172
dist
173-
.DS_Store
173+
.DS_Store
174+
175+
# Example persistence state files
176+
examples/.cronbake-state.json
177+
examples/cronbake-state.json
178+
*.cronbake-state.json

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# cronbake
22

3+
## 0.3.2
4+
5+
### Fixes
6+
7+
- Persistence: Fix job redefinition warning by allowing user-defined jobs to replace restored jobs without conflicts ([#14](https://github.com/chaqchase/cronbake/issues/14)). Previously, restarting an app with updated job configurations would show a warning "Failed to restore job 'my-job': warn: Cron job with name 'my-job' already exists". Now, user-defined configurations take precedence over restored state.
8+
- Runtime: Failed job executions now bubble up properly so metrics/history and `lastError` reflect the failure, and `onError` handlers still fire exactly once.
9+
- Runtime: `baker.lastExecution()` uses the timestamp of the most recent actual run and `Cron.time()` once again reports the remaining delay rather than the current epoch time, matching the documented API.
10+
11+
### Minor Changes
12+
13+
- Persistence: Honor the `persist` flag per job so only opted-in jobs are saved/restored, and hydrate metrics/history snapshots during restore.
14+
- API: Added `baker.ready()` to await automatic restoration before interacting with jobs; `autoStart` now waits for persistence to finish.
15+
- DX: Prevent redundant persistence writes during restore for faster startups and fewer warnings.
16+
- Metadata: Point npm metadata to `chaqchase/cronbake`.
17+
- Docs: Added `examples/` folder plus README guidance so common use cases have copy-paste starting points without bloating published bundles.
18+
319
## 0.3.1
420

521
### Patch Changes

0 commit comments

Comments
 (0)