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

Have ID_LIST read from a file or redis key instead #3

Open
lost-theory opened this issue Jun 6, 2014 · 1 comment
Open

Have ID_LIST read from a file or redis key instead #3

lost-theory opened this issue Jun 6, 2014 · 1 comment

Comments

@lost-theory
Copy link

You can retry specific IDs using the ID_LIST environment variable like this:

$ ID_LIST=1,2,99,100 bundle exec my_script.rb

If you need to retry hundreds of thousands or millions of IDs this won't work because there are limits on the length of a command. On our servers the limit is 2621440 bytes = 2.5 megabytes (getconf ARG_MAX), which would be about 250k IDs if IDs are ~10 bytes long.

If ID_LIST (or another environment variable) caused scripterator to read from a file or redis then you could have an arbitrarily long list of IDs. Some examples of what it might look like:

#read IDs from redis list or set
$ ID_LIST=one_timer_script:blabla:retry bundle exec my_script.rb

#read first 100k IDs from redis list
$ ID_LIST=one_timer_script:blabla:retry START=1 END=100000 bundle exec my_script.rb

#read IDs from file
$ ID_LIST=/tmp/ids.txt bundle exec my_script.rb
@linedotstar
Copy link

or read from a URL (like a gist)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants