-
Notifications
You must be signed in to change notification settings - Fork 7
Move On Cancellation Logic to After Failure Hook #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
fb2ce69
c3f53e3
77f8014
e709a9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,13 +35,23 @@ Run the required database migrations: | |
$ rails generate delayed_job_groups_plugin:install | ||
$ rake db:migrate | ||
|
||
## Upgrading from 0.14.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is true for the initial installation too, right? If you're up for it, maybe it would be nice to include in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the generator to set the option, let me know what you think! Had to find a work around for being able to run the generator with the gem included, since generators run after railties run... We can assume the library hasn't been fully setup until the table is present, so we can skip raising the error in that case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks great! |
||
|
||
This library is now incompatible with Delayed::Job's default setting for `destroy_failed_jobs`. | ||
In order to use Delayed Job Groups, you must set it to false while configuring Delayed::Job: | ||
|
||
```ruby | ||
Delayed::Worker.destroy_failed_jobs = false | ||
``` | ||
|
||
## Upgrading from 0.1.2 | ||
run the following generator to create a migration for the new configuration column. | ||
|
||
$ rails generate migration add_failure_cancels_group_to_delayed_job_groups failure_cancels_group:boolean | ||
# add `default: true, null: false` to the generated migration for the failure_cancels_group column | ||
$ rake db:migrate | ||
|
||
|
||
## Usage | ||
|
||
Creating a job group and queueing some jobs: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
module Delayed | ||
module JobGroups | ||
ConfigurationError = Class.new(StandardError) | ||
|
||
class IncompatibleWithDelayedJobError < ConfigurationError | ||
DEFAULT_MESSAGE = 'DelayedJobGroupsPlugin is incompatible with Delayed::Job ' \ | ||
'when `destroy_failed_jobs` is set to `true`' | ||
|
||
def initialize(msg = DEFAULT_MESSAGE) | ||
super(msg) | ||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
|
||
module Delayed | ||
module JobGroups | ||
VERSION = '0.14.0' | ||
VERSION = '1.0.0' | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include this in the README too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added! thoughts?