forked from OptimalBits/bull
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow updating job error/attempt info via script
Affects the following scripts: - moveToDelayed - moveToFinished - retryJob Allows for the `attemptsMade`, `stacktrace` and `message` fields to be updated through Lua scripts, rather than requiring a separate operation (or multiple operations) to set these fields. With the possibility of setting these fields within the context of a single script, we avoid the need to craft a transaction containing both HMSET and EVAL(SHA) commands to achieve atomicity. By shedding the need for a transaction, we are able to avoid redis/ioredis#536 and thus solve a common problem seen when targetting Redis clusters. This isn’t necessarily an ideal means of solving this problem, given we’re violating DRY principles by copying the same logic across scripts. It’d be ideal if the underlying ioredis restriction was removed (in a manner which doesn’t entail the performance cost of resubmitting scripts each time).
- Loading branch information
Showing
4 changed files
with
57 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters