-
Notifications
You must be signed in to change notification settings - Fork 201
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
Running as standalone server #307
Comments
Hello, the explicit explanation is "rufus-scheduler is not a cron replacement". It's not a Maybe https://github.com/javan/whenever is a better tool for you. I, personally, mostly use rufus-scheduler inside of Ruby applications (Rack - Sequel) to run jobs intermittently. I think that testing will give the answer to your Regarding good practice, one has to know if the scheduling process is running or not, and, in case of errors, the errors must be logged somewhere. Heroku or self-hosted or whatever the solution, this differs. These might also be interesting to you: https://devcenter.heroku.com/articles/scheduler and https://devcenter.heroku.com/articles/scheduled-jobs-custom-clock-processes#custom-clock-processes I am not sure I'd want an addition to the README. That'd be widening the area for which people expect me to provide answers. Closing the issue but not the conversation. Thanks. |
Thanks for the quick response! everything you said to get me away from rufus-scheduler is pretty much the exact line of reasoning that brought me to rufus-scheduler 😄
app/lib/runner_error_reporter.rb class RunnerErrorReporter < Rails::Railtie
runner do
at_exit do
next unless $!
next if SystemExit == $!.class && $!.success?
ErrorTrackerService.track_exception($!)
end
end
end here's my analysis of the space: Here's my POC (no schedule.rb require 'rufus-scheduler'
scheduler = Rufus::Scheduler.new
scheduler.every '1 second' do
puts User.count
end
scheduler.join
|
Excellent! |
Hi,
Thanks for what looks like a great project!
Maybe I'm misreading the readme but it seems like there is no explicit explanation for how to run rufus as a standalone server. I'm not sure if I'm not seeing this because it's very obvious that it's possible or because it's totally not intended to be used as such 😅
If I have a script schedule.rb
Is it good practice to then run this as a persistent process (e.g. in a heroku Procfile or with systemd) with
bundle exec schedule.rb
?Furthermore, if I have a script that needs access to a rails app environment:
Can I run it in a persistent process with
bundle exec rails runner schedule.rb
?or will that not work for some reason, and it's better to use the approach suggested by https://github.com/Rykian/clockwork:
Sorry if this is already covered somewhere - I'll try to submit an update for the readme if you think that's a good idea.
The text was updated successfully, but these errors were encountered: