whenever icon indicating copy to clipboard operation
whenever copied to clipboard

Issue when using runner

Open goldenking0412 opened this issue 4 years ago • 2 comments

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

goldenking0412 avatar May 26 '21 12:05 goldenking0412

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.

KevinTriplett avatar Aug 05 '22 17:08 KevinTriplett

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?

marckohlbrugge avatar Jan 23 '24 10:01 marckohlbrugge