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

Issue when using runner #816

Open
goldenking0412 opened this issue May 26, 2021 · 2 comments
Open

Issue when using runner #816

goldenking0412 opened this issue May 26, 2021 · 2 comments

Comments

@goldenking0412
Copy link

When I use runner, I have issue in crontab -e

In config/schedule.rb

every 2.minutes do
  runner "GuestsCleanupJob.perform_now"
end

In crontab -e

0,12,24,36,48 * * * * /bin/bash -l -c 'cd /home/ubuntu/testapp && bundle exec bin/rails runner -e production '\''GuestsCleanupJob.perform_now'\'''

I am sure the crontab update is error.
'\''GuestsCleanupJob.perform_now'\'''

Why crontab is updated like this?

Thanks

@KevinTriplett
Copy link

KevinTriplett commented Aug 5, 2022

I refactored my class method into a rake task, which helps me run the task manually whenever I want. I also don't understand the extra single-quotes.

@marckohlbrugge
Copy link

marckohlbrugge commented Jan 23, 2024

I run into a similar issue:

  runner "AdminNotifier.deliver('Cronjobs are working!')"

becomes

cd /rails && bundle exec bin/rails runner -e production '\''AdminNotifier.deliver('\''\'\'''\''Cronjobs are working!'\''\'\'''\'')'\'' >> /proc/1/fd/1 2>&1

I suggest not using runner as it seems unreliable. Maybe the README can be updated?

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

No branches or pull requests

3 participants