All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
6.3.0 (2022-12-09)
- add localLockLimitReached (af90bcb)
- add error message to forked child and give it a chance to die (7cf3c57)
6.2.13 (2022-11-17)
- ready and error events are allowed wihtin sub workers (cb4228c)
- use definition keys for status list (485060a)
6.2.12 (2022-08-02)
- improve error message for on handler (92d42ca)
6.2.11 (2022-05-23)
- bind correct context to process (cf70739)
6.2.10 (2022-05-23)
6.2.9 (2022-05-20)
- job timeout check and improve error handling for childs (b365957)
6.2.8 (2022-05-11)
- use message bus instead of signal to cancel child (fcec3a9)
6.2.7 (2022-05-11)
- use different appraoch to find definition file (9d4c60e)
6.2.6 (2022-05-10)
- add fork paramters to console (9f2e7fd)
6.2.5 (2022-05-10)
- improve exit code error message (f1a5eb8)
6.2.4 (2022-05-10)
- check if abort controller is supported (a00d611)
6.2.3 (2022-05-10)
6.2.2 (2022-05-10)
- allow passing forkMode to every (ff274ba)
6.2.1 (2022-05-10)
- small code cleanups and new flag to toggle (2a6e5fe)
6.2.0 (2022-05-09)
- allow to fork jobs in isolated sub process (2a68c95)
6.1.1 (2022-04-05)
6.1.0 (2022-03-21)
- check if job state update was successful before running a job (606e141)
6.0.9 (2022-03-18)
6.0.8 (2022-01-10)
6.0.7 (2021-12-12)
6.0.6 (2021-12-10)
- ensure locked at is processed as date (3a5a0c4)
6.0.5 (2021-12-10)
6.0.4 (2021-12-05)
- nextRunAt value can be null (e39cfd0)
6.0.3 (2021-12-03)
- check if job has expired before we run it (e301511)
6.0.2 (2021-10-28)
6.0.0 (2021-08-27)
- Upgrade to mongo driver 4
5.0.1 (2021-02-12)
- update deps and switch moment-timezone to luxon (e5eb973)
5.0.0 (2020-12-06)
-
Switching from ncb000gt/node-cron to harrisiirak/cron-parser for cron-pattern parsing.
Previously month was 0-based (0=January). Going forward standard Unix pattern is used, which is 1-based (1=January).
Please update existing cron-patterns that specify a month (4th position of a pattern). The month is now 1 - 12
1 = January
2 = February
3...
Example Execute on 1st of January Old 0 0 1 0 * New 0 0 1 1 * old Cron patterns
* * * * * * | | | | | | | | | | | +-- Year (range: 1900-3000) | | | | +---- Day of the Week (range: 1-7, 1 standing for Monday) | | | +------ Month of the Year (range: 0-11) NOTE: Difference here | | +-------- Day of the Month (range: 1-31) | +---------- Hour (range: 0-23) +------------ Minute (range: 0-59)
new cron patterns
* * * * * * | | | | | | | | | | | +-- Year (range: 1900-3000) | | | | +---- Day of the Week (range: 1-7, 1 standing for Monday) | | | +------ Month of the Year (range: 1-12) NOTE: Difference here | | +-------- Day of the Month (range: 1-31) | +---------- Hour (range: 0-23) +------------ Minute (range: 0-59)
Co-authored-by: Aras Abbasi a.abbasi@cognigy.com
4.1.6 (2020-11-19)
- only unlock jobs with a next run at date on shutdown (a458aea)
4.1.5 (2020-11-19)
- jobprocessor: ensure set timeout is only called once for each job in the queue (1590224)
4.1.4 (2020-11-18)
- jobprocessor: check if set timeout value is valid (2afaaa3)
4.1.3 (2020-10-30)
- only unlock jobs which have a nextRunAt jobs on shutdown (291f16e)
- simplify default values (35d5424)
4.1.2 (2020-10-25)
4.1.1 (2020-10-25)
- isRunning, check if db returns a result (e6ea7e2)
4.1.0 (2020-10-25)
- isRunning querys database again if called by client (1aaaa61)
- job processor handling for recurring jobs could fill up queue and block processing (54bc53c)
- job processor localQueueProcessing flag (413f673)
- rename err to error, fix typing of DefinitionProcessor, use debug ins… (#9) (39b598e)
- use isNaN check in isValidDate (#10) (3bc2e30)
4.0.33 (2020-10-24)
- fix outpout of agenda job status details (82ab1a8)
- fix outpout of agenda job status details (7b24f88)
- fix outpout of agenda job status details (3dc0709)
4.0.32 (2020-10-24)
- logic for datbase connection (7ee64c1)
4.0.31 (2020-10-23)
- job-processor: emit error when db query fails (9bfabd3)
4.0.30 (2020-10-23)
- job-processor: emit error when db query fails (eff80aa)
4.0.29 (2020-10-22)
4.0.28 (2020-10-20)
- tests: rm console log from debugging (b211c8e)
4.0.27 (2020-10-20)
- define: warning if job definition exists already (3fe9a6d)
- job: ensure agenda is ready before calling save job (be4c026)
- test: cleanup tests (c5d081a)
- test: debug failed lock expire test (7d69680)
- test: debug failed priority test (924287c)
- test: fix timeout check (e92cd85)
- typings: names -> name (c2ca928)
4.0.26 (2020-10-20)
- test: just check if there are almost all jobs running (b2a5e6e)
4.0.25 (2020-10-20)
- jobprocessor: check for object.fromEntries for node 10 support (#3) (b8cc61f)
- jobprocessor: ensure returnNextConcurrencyFreeJob is not returning same job each time (11d6606)
- jobprocessor: set job enqueud to true for future jobs (a3d4203)
- test: unlock job test fix (6446b64)
- more typings, minor functionality changes (#2) (b13d054)
4.0.24 (2020-10-20)
- jobprocessor: improve checkIfJobIsStillAlive (2919083)
- jobprocessor: prevent overloading of job queue processing (9854007)
4.0.22 (2020-10-16)
- jobprocessor: introduce a canceled property to check if job is still alive (55b63d7)
4.0.21 (2020-10-15)
- add job name again stats output (1aa2d4a)
- Add try/catch block to agenda#now method (#876) (8e1fe23)
- add types for chai and fix expect in agenda.test.ts (7d508a9)
- add typings for events (a6c0356)
- allow data type defintions for jobs (ef85fc5)
- allow returing details for status (7a8a5bf)
- check if job is still alive (a39c809)
- ensure check if job is dead is ending sometime :-) (39950f3)
- ensure jobs are filled up till concurrency reached (1a8bb31)
- ensure new jobs are put on the left side of the job processing queue (30e68ba)
- export all kind of types (3bd90dc)
- improve locking and ensure locks are released (3160f0d)
- make
touch
promise-based (#667) (0840588), closes /github.com/agenda/agenda/blob/ff94c8a4c9bc564a0bed9eaa79de1c4fdbed0fde/lib/job/touch.js#L10-L13 /github.com/agenda/agenda/blob/bd8a8e003cd09d6e9826accbf6c30be75212a9a9/test/job.js#L352-L364 - not running jobs even though concurrency is not reached (0e82025)
- simplified verbiage (ee3ce39)
- simplify unlocking and improve logging (a70f500)
- skip index creation (5242736)
- tests, agenda-instance should have a smaller processEvery (b248a2b)
- try to solve the locking issue (d2f3b20)
- use new mongo stack (a2e74a9)
- locking: ensure jobs are not locked too greedy (5bc123a)
- process-jobs: also add name to lock call (481ea77)
- update: when saving a job via _id add job name (24f6a84)
Stay safe!
- Fix for skipImmediate resetting nextRunAt to current date (#860) (Thanks @AshlinDuncan!)
- Fix deprecated reconnect options (#948) (Thanks @ekegodigital!)
- Add ability to set a skip when querying jobs. (#898) (Thanks @cjolif!)
Internal:
- Fixed deprecated MongoDB functions in tests (#928) (Thanks @MichielDeMey!)
- Updated devDependencies
Thank you @koresar, @sampathBlam, and @MichielDeMey helping to review PRs for this release! 👏
- Support MongoDB's Unified Topology Design (#921) (Thanks @viktorzavadil!)
- Fix: check that the new nextRunAt is different that the previous nextRunAt (#863) (Thanks @RaphaelRheault!)
- Update dependencies. Most notably MongoDB driver 3.4 → 3.5 (#899, #900, #903, #906, #908, #910, #912, #913, #920, #922)
- Documentation updates, thanks @MichielDeMey and @Sunghee2. (#923 & #907)
- Stop testing for Node.js 8. This might still work but we're no longer actively testing for it. (#925)
- Improved performance in situations when there are many "expired" jobs in the database (#869) (Thanks @mfred488!)
- Fix periodic node.js process unhandledRejection (#887) (Thanks @koresar and @Scorpil)
- Update dependencies
- Fix
skipImmediate
option in.every
(#861) (Thanks @erics2783!) - Add try/catch block to agenda#now method (#876) (Thanks @sampathBlam!)
- Refactor job queuing mechanism. Agenda n ow guarantees priority when executing jobs scheduled the same datetime. Fixes also some tests. (#852) (Thank you @dmbarreiro!)
- Update dependencies (Kudos @simison!)
Most notably
mongodb
~3.2.7 -> ~3.3.0 (changelog) — highlights:- Mongo DB Server Version 4.2 feature support
- Merged
mongodb-core
intonode-mongodb-native
- Beta support for MongoDB Client-Side Encryption
- SRV Polling for Sharded Clusters
- Updates to documentation (Thank you @lautarobock, @sampathBlam, @indatawetrust)
- Support async functions in job processing (#653) (thanks @princjef!)
- Allow sorting and limiting jobs when searching (#665) (thank you @edwin-jones)
- Update MongoClient connection settings with
useNewUrlParser: true
to remove the deprecation warning. (#806) (thanks @dpawson905!) - Allow valid date strings when scheduling (#808) (Thanks @wingsbob!)
- Update dependencies (#820)
- Update documentation (kudos @dandv, @pedruino and many others!)
- Fix linting errors (#847) (thanks @dmbarreiro!)
- Fixes a MongoDB connection string issue with Atlas (#674
- Fix a bug where
job.touch()
wasn't promise based, as it should've been (#667
- Rewrite tests: replace
mocha
andblanket
withava
andnyc
(#506) - Optimization: don't try and unlock jobs when
_lockedJobs
is empty (#509) - Code cleanup (#503)
- Ensure tests pass for Node.js version 10 #608)
- Add
skipImmediate
torepeatEvery()
options to skip immediate run of repeated jobs when Agenda starts. See documentation (#594) - Fixes some flaky tests
- Adds docs generator (
npm run docs
to generate/docs
)
-
Rewrite Agenda API support promises! (#557)
No more callbacks! Instead of:
function graceful() { agenda.stop(function() { process.exit(0); }); }
You need to:
async function graceful() { await agenda.stop(); process.exit(0); }
You don't anymore have to listen for
start
event. Instead you can do:await agenda.start(); agenda.every('10 minutes', 'example');
However, this will still work:
agenda.on('ready', function () { agenda.every('10 minutes', 'example'); agenda.start(); });
See the documentation for more!
-
Drop support for MongoDB 2.4 (#497)
-
Update Native MongoDB driver to 3.1 from 2.2 (#616)
-
Jobs emit errors instead of throwing them
- Update dependencies (2854c7e)
- Update dependencies (2854c7e)
- Update dependencies
cron
anddebug
(#505)
-
Fix jobs not running in order of them being queued (#464)
-
Changes in Cron string parsing, changed parsing library from ncb000gt/node-cron to harrisiirak/cron-parser (#475)
Previously Agenda would treat months as 0-11 where as normally, cron months are parsed as 1-12.
* * * * * *
| | | | | |
| | | | | +-- Year (range: 1900-3000)
| | | | +---- Day of the Week (range: 1-7, 1 standing for Monday)
| | | +------ Month of the Year (range: 0-11) NOTE: Difference here
| | +-------- Day of the Month (range: 1-31)
| +---------- Hour (range: 0-23)
+------------ Minute (range: 0-59)
Starting in version 1.0.0
, cron will be parsed in the standard UNIX style:
* * * * * *
| | | | | |
| | | | | +-- Year (range: 1900-3000)
| | | | +---- Day of the Week (range: 1-7, 1 standing for Monday)
| | | +------ Month of the Year (range: 1-12) NOTE: Difference here
| | +-------- Day of the Month (range: 1-31)
| +---------- Hour (range: 0-23)
+------------ Minute (range: 0-59)
- Adds debugging, see instructions from README.md.
- Unpublished and re-published as v0.10.2
- Replace the deprecated
findAndModify
method from native MongoDB driver tofindOneAndUpdate
(#448) - Going forward, we won't ensure Node.js v0.10 and v0.11 compatibility anymore (#449)
- Code cleanup (#491, #489, #488, #487)
Republish release for NPM. Includes fixes from 0.9.0 release:
- add support for
mongoose.connection
foragenda.mongo()
, fixes #156 - Fix for race condition in the afterEach clean up code (#355)
- Fixes + protects against concurrency not being honored (#379)
- add support for
mongoose.connection
foragenda.mongo()
, fixes #156 - Fix for race condition in the afterEach clean up code (#355)
- Fixes + protects against concurrency not being honored (#379)
- Bump mongodb dep version to support ssl conns (#368)
- Increase Mongo compatability to 2.4
- Add Node v6 to CI
-
- Update dev dependencies for out of date. 2. Small fix to job.js for invalid repeatAt
- Update .npmignore
- Fix doc: cb not marked as optional (closes #279)
- Including nextRunAt check in query for on the fly lock.
- Picking up any job with an expired lock (not just recurring or queued).
- Fixed failing test
- throw on processJobResult error
- Requeuing concurrency blocked jobs wrt priority.
- Processing the next job that is not blocked by concurrency.
- Fix test which fails only sometimes
- Add agendash as alternative ui
- Merge pull request #288 from diesal11/master
- Implementing lock limit
- Use callback to handle errors if we can.
- fix: ReferenceError: MongoError is not defined
- fix: computeNextRunAt timezone bug
- feat: add timezone option for repeatAt.
- fix: job locking logic
- fix: bug with jobs expiring and being enqueued anyway
- fix: bug where jobs wouldn't run concurrently
- fix: agenda throwing an exception when starting a job defined on another instance
- fix: possible bug when using extended Array.prototype
- feat: Add failCount attribute to jobs
- fix: job priority for on the fly job lock and queueing is now respected
- fix: make agenda.cancel no longer require a callback
- fix: stale jobs running after a more up-to-date job has completed
- fix: fail/success event emit after jobs have been saved in the database
- fix: ready event when using config.mongo
- Adds options.insertOnly to job.unique that prevents the job from being updated multiple times on multiple runs
- fix job priority scheduling
- add support for success callbacks on schedule, every and now (@mgregson)
- using self for reference to collection (@3choBoomer)
- emit ready from db_init (@jdiamond)
- Rollback job completion callback to pre-0.7.0
- Emit events when Agenda init is ready or has failed
- Switch from mongoskin to mongodb native. Big thanks to the classdojo team for this. Shoutouts to @liamdon, @jetzhou and @byronmwong for the help!
- Fix for when _findAndLockNextJob returns multiple jobs.
- code cleanup, fix leaking ignoreErrors
- fix double run bug
- Allow specifying mongo config (optionally)
- Fix .every() running when using cron strings.
- Remove debugger
- add job.unique (@nwkeeley)
- Re-add tests for those who use the
npat
option.
- add job.disable() and job.enable()
- Added .npmignore for test/ build scripts.
- Create database indexes when initializing Agenda instance (@andyneville)
- Implemented job.isRunning()
- Fixed issue where jobs would continue being processed after agenda is explicitly stopped
- Fixed complete event being emitted before asynchronous jobs are finished
- add job.repeatAt
- fix job queue being processed even when agenda was stopped
- fix agenda.every method
- fix agenda.every overwriting nextRunAt [closes #70]
- Added agenda.cancel function
- Fix more circumstances where jobs re-create after remove
- fix jobs resaving after remove [closes #66]
- fix jobs skipping in line from database querying
- update saveJob to allow for pre-set Ids [closes #64]
- add job.touch to reset lock lifetime [references #63]
- make job saving use agenda._name
- add agenda.name config method
- fix agenda.mongo not being chainable
- add graceful job unlocking to stop
- Implement, document, and test defaultLockLifetime [@shakefu]
- Bump date.js version [@psema4]
- mongoskin version bump (better support for mongodb 2.6) [@loginx]
- fix $setOnInsert with empty obj cause mongodb 2.6 complain [@inetfuture]
- fix cron-jobs executing multiple times
- fail the job if repeat interval is wrong
- fix bug that resulted in jobs scheduled in memory to always re-run
- Update mongoskin to 1.3
- allow every and schedule to take array of job names
- convert to using setTimeout for precise job scheduling [closes #6]
- fix agenda.every not properly saving jobs
- improve instantiating jobs, fixes bug where certain attrs weren't loaded in
- add job#remove method
- Fixed single jobs not being saved properly [closes #38]
- fix every re-running jobs out of queue at load
- Added failing for jobs with undefined definitions
- Added agenda.purge() to remove old jobs
- added support to directly give mongoskin object, to help minimize connections
- Added start event to jobs. (@clayzermki)
- Added agenda.now method
- Added ability for job.fail to take an error
- Updated version of humanInterval, adding weeks and months support
- Added job locking mechanism, enabling support for multiple works / agenda instances (@bars3s)
- fix job.toJson method: add failReason & failedAt attrs (Broken in 0.4.3 and 0.4.2)
- fix job cb for working with 'q' promises
- fix job.schedule's taking Date object as 'when' argument [@bars3s]
- Refactored Job to ensure that everything is stored as an ISODate in the Database. [Closes #14] [@raisch]
- Added support for synchronous job definitions
- Added Cron Support [Closes #2]
- removed modella dependency
- Fix for setImmediate on Node 0.8
- Added Events to the Event Queue [References #7]
- Fixed a bug where mongo wasn't giving updated document
- Added error for running undefined job. [Closes #4]
- Fixed critical error where new jobs are not correctly saved.
- Small Bug fix for global-namespace pollution
- Updated write concern to avoid annoying notices
- Removed unecessary UUID code
- Initial Release