@@ -19,35 +19,88 @@ to make sure the system as a whole remains consistent.
1919Read more:
2020[ Worker Pro Migration] ( https://worker.graphile.org/docs/pro/migration ) .
2121
22- ## Pending
23-
24- - BREAKING: Jobs and queues are now ` locked_by ` their ` WorkerPool ` 's id rather
25- than the ` workerId ` . Be sure to upgrade
26- [ Worker Pro] ( https://worker.graphile.org/docs/pro ) at the same time if you're
27- using it!
22+ ## v0.18.0
23+
24+ - Since Node 20 is EOL, Node 22 is now the minimum supported version, per our
25+ [ requirements documentation] ( https://worker.graphile.org/docs/requirements ) .
26+ - ` Runner ` gains ` [Symbol.asyncDispose]() ` method, so you can
27+ ` await using runner = await run(...) ` and the worker will be released when you
28+ reach the end of the scope. (Primarily useful for tests.)
29+ - Maintenance work: upgrade to latest TypeScript, Jest, eliminate ts-node, fix
30+ yargs, use erasable syntax only for type-stripping support,
31+
32+ ## v0.17.2
33+
34+ Implement ` npm pkg fix ` hint; also: fix ` version ` export - was _ still_
35+ incorrectly reporting 0.17.0-rc.0, because ` npm publish ` doesn't call ` prepack `
36+ when ` ignore-scripts ` is ` true ` .
37+
38+ ## v0.17.1
39+
40+ Fix ` version ` export - was incorrectly reporting 0.17.0-rc.0.
41+
42+ ## v0.17.0
43+
44+ Major performance enhancements in this release, but they're opt-in!
45+
46+ - BREAKING: jobs and queues are now ` locked_by ` their ` WorkerPool ` 's id rather
47+ than the ` workerId ` .
48+ - BREAKING: Worker Pro users need to update to ` @graphile-pro/worker@0.2.x ` at
49+ the same time as updating Graphile Worker to this release (due to the above
50+ breaking change).
51+ - BREAKING: We'll now warn you if you haven't installed error handlers on the
52+ pool, and will only install them ourself if needed.
53+ - BREAKING: Fixes bug where CLI defaults override ` graphile.config.js ` settings
54+ (by removing CLI defaults).
55+ - New ** batching of job completion** can be enabled by setting
56+ ` preset.worker.completeJobBatchDelay ` and ` preset.worker.failJobBatchDelay ` to
57+ a number ` 0 ` or higher. This can significantly reduce load on the database, at
58+ the cost of potentially leaving more locked jobs if worker crashes or is
59+ killed without cleanup before the batch executes.
60+ - New ** local queue** can be enabled by setting ` preset.worker.localQueue.size `
61+ to ` 1 ` or higher (recommend setting it to ` concurrency + 1 ` ). This allows jobs
62+ to be fetched in a batch and distributed locally rather on-demand fetching
63+ from each worker in the local pool; this significantly reduces load on the
64+ database especially if you're running with high concurrency. The trade-off is
65+ that more jobs will be locked at a time, and when local queues are full higher
66+ priority tasks added to the database won't be "seen" until the local queue is
67+ refetched.
2868- New ` addJobs() ` JS method to enable efficiently adding a batch of jobs via the
29- JS API
69+ JS API.
70+ - Prepared statements can now be disabled via
71+ ` preset.worker.preparedStatements = false ` , useful when connecting to the
72+ database in a way that does not reliably support them. There's a minor
73+ performance penalty, so only turn them off if you need to.
74+ - New ` middleware ` system enabled by ` graphile-config ` is now preferred over
75+ hooks (which will be deprecated and removed in later versions). Middleware
76+ better enable activities to be wrapped, e.g. ` bootstrap ` middleware can take
77+ actions both before and after bootstrapping and share variables between them,
78+ rather than the old ` prebootstrap ` /` postbootstrap ` hooks which need more
79+ complex integration.
80+ - Fixed issue with cron where enough errors (for example due to database
81+ downtime) would cause it to stop trying, leaving a seemingly healthy worker
82+ that wasn't executing cron. Cron will now retry startup indefinitely (with
83+ exponential backoff) _ and_ will perform the relevant backfills when the
84+ connection is re-established.
3085- DEPRECATION: ` quickAddJob ` has been renamed to ` addJobAdhoc ` to make it
3186 clearer that it's for use in one-off locations (some felt the "quick" referred
3287 to the speed it executed, rather than the amount of effort required from the
33- programmer)
34- - We'll now warn you if you haven't installed error handlers on the pool, and
35- will only install them ourself if needed
36- - Fixes bug where CLI defaults override ` graphile.config.js ` settings (by
37- removing CLI defaults)
88+ programmer).
3889- Fix bug where executable tasks had their stdout/stderr ignored; this is now
3990 output via logging (thanks @wineTGH ).
4091- Fix race condition when multiple workers attempt to initialise the database at
41- the same time
92+ the same time.
4293- ` helpers.abortSignal ` is no longer typed as ` | undefined ` . It is still
4394 experimental!
4495- ` helpers.abortPromise ` added; will reject when ` abortSignal ` aborts (useful
45- for ` Promise.race() ` )
96+ for ` Promise.race() ` ).
4697- ` backfillPeriod ` is now marked as optional in TypeScript (defaults to 0).
4798- Support for loading tasks from nested folders in crontab.
4899 - (` * * * * * nested/folder/task ?jobKey=my_key&jobKeyMode=preserve_run_at ` )
49100- Most of our event emitters now trap errors and output a log if such error were
50101 to occur - useful for debugging.
102+ - Worker event payloads now include ` ctx ` , making plugin/event integrations more
103+ consistent.
51104
52105## v0.16.6
53106
0 commit comments