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

job_type itself shouldn't be parsed #520

Closed
hamedrnik opened this issue Dec 31, 2014 · 6 comments
Closed

job_type itself shouldn't be parsed #520

hamedrnik opened this issue Dec 31, 2014 · 6 comments
Labels

Comments

@hamedrnik
Copy link

Hi,
I have a rake task in schedule.rb like below:

every 3.minutes do
  rake "db:update_something[4.minutes.ago.utc]"
end

The problem is whenever parse rake task itself and the result would be something like:

0 0 * * * /bin/bash -l -c 'cd /my_project && RAILS_ENV=production bundle exec rake db:update_something[240.ago.utc] --silent'

which is incorrect. Is this expected behaviour to parse "db:update_something[4.minutes.ago.utc]" into
"db:update_something[240.ago.utc]"? becuase "[4.minutes.ago.utc]" is the parameter of the rake task and I don't want to be parsed.

FYI:
I'm using ruby 2.2.0, whenver 0.9.4 and chronic 0.10.2.

@paulmenzel
Copy link

Hi. I experience the same problem. Sorry for not being more helpful.

@robvolk
Copy link

robvolk commented Mar 31, 2015

bump. facing the same issue : /

@robvolk
Copy link

robvolk commented Mar 31, 2015

I found a workaround @IceAge, just add `#{4}.minutes.aog' - crazy I know.

every 3.minutes do
  rake "db:update_something[#{4}.minutes.ago.utc]"
end

@hamedrnik
Copy link
Author

@robvolk Thanks, good one and it works!

@benlangfeld
Copy link
Collaborator

Per @javan, we'll need to avoid parsing Ruby code inside quotes: #530 (comment)

@benlangfeld
Copy link
Collaborator

This is fixed by This was fixed by #587.

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

No branches or pull requests

4 participants