Skip to content

Commit

Permalink
Rename "args_for_retry" to "retry_args"
Browse files Browse the repository at this point in the history
Done for consistency w/ the addition of the "retry_args_for_exception"
method
  • Loading branch information
jzaleski committed Jun 26, 2014
1 parent a77b2cf commit 303441e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -332,15 +332,15 @@ job should retry.

### Retry Arguments

You may override `args_for_retry`, which is passed the current
You may override `retry_args`, which is passed the current
job arguments, to modify the arguments for the next retry attempt.
```ruby
class DeliverViaSMSC
extend Resque::Plugins::Retry
@queue = :mt_smsc_messages

# retry using the emergency SMSC.
def self.args_for_retry(smsc_id, mt_message)
def self.retry_args(smsc_id, mt_message)
[999, mt_message]
end

Expand Down
4 changes: 2 additions & 2 deletions lib/resque/plugins/retry.rb
Expand Up @@ -154,7 +154,7 @@ def retry_job_delegate
# @return [Array] new job arguments
#
# @api public
def args_for_retry(*args)
def retry_args(*args)
args
end

Expand All @@ -166,7 +166,7 @@ def args_for_retry(*args)
#
# @api public
def retry_args_for_exception(exception, *args)
args_for_retry(*args)
retry_args(*args)
end

# Convenience method to test whether you may retry on a given
Expand Down
2 changes: 1 addition & 1 deletion test/test_jobs.rb
Expand Up @@ -105,7 +105,7 @@ class InheritTestWithMoreExtraJob < InheritTestWithExtraJob
class RetryWithModifiedArgsJob < RetryDefaultsJob
@queue = :testing

def self.args_for_retry(*args)
def self.retry_args(*args)
args.each { |arg| arg << 'bar' }
end
end
Expand Down

4 comments on commit 303441e

@lantins
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will require a major version bump as its a breaking change to the public API!

@jzaleski
Copy link
Collaborator Author

@jzaleski jzaleski commented on 303441e Jun 27, 2014 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lantins
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets go down the deprecated route please, it will still require a major version bump, but not just yet!

@jzaleski
Copy link
Collaborator Author

@jzaleski jzaleski commented on 303441e Jun 27, 2014 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.