Skip to content
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

Added optional limit to mv method #342

Closed
wants to merge 1 commit into from

Conversation

parov
Copy link

@parov parov commented Mar 20, 2017

In order to use the mv method from outside the CLI, we need to set the limit

Fix #339

@@ -158,11 +158,11 @@ def requeue(queue_name, path)
desc 'mv QUEUE-NAME-SOURCE QUEUE-NAME-TARGET', 'Move messages from one queue (source) to another (target)'
method_option :number, aliases: '-n', type: :numeric, default: Float::INFINITY, desc: 'number of messages to move'
method_option :delete, aliases: '-d', type: :boolean, default: true, desc: 'delete from the queue'
def mv(queue_name_source, queue_name_target)
def mv(queue_name_source, queue_name_target, limit: nil)
Copy link
Collaborator

@phstc phstc Mar 21, 2017

Choose a reason for hiding this comment

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

@parov if feels like hacky doing that, it's a thor task, it's supposed to be called as a thor task. I wouldn't add an extra param, just for making it available for outside, the possible options:

  1. Invoke it as a thor task. See https://github.com/erikhuda/thor/wiki
  2. subprocess system(bundle exec shoryuken sqs mv ...)
  3. Extract this mv to a class (not a thor one) and use this class here and in your controller

See #339 (comment)

Copy link
Author

Choose a reason for hiding this comment

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

thanks @phstc. Sub-processing looks a good solution for this one time tasks

Copy link
Collaborator

Choose a reason for hiding this comment

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

@parov BTW probably later today I will release a new version with purge support #344

@parov parov closed this Mar 24, 2017
@parov parov deleted the feature/CLI_limit branch March 24, 2017 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants