-
Notifications
You must be signed in to change notification settings - Fork 479
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
Scheduled jobs not shown under Schedule tab #541
Comments
Is resque-scheduler running when you looked at the schedule? Any odd Redis/Resque configuration or initializer settings? |
I did a grep for 'resque' and 'redis' in config/. The only result was the following (in an initializer).
I removed this line and restarted everything, but the tab was still bare. Hope that helps :-) |
I can confirm this. |
I cannot reproduce this issue. I've never used the web interface but I tried to load the web server using I'm a bit busy these days but if I can get quick steps to reproduce I'm willing to help |
In resque-web go to Stats -> keys, is there a |
Hello all (sorry for the delay in replying). I can confirm these same:
|
The My guess is that @benthorner and @Janther (and most deployments really) run the web server independently of resque-scheduler (for example through their rails app). |
...so basically you just need to ensure you have something like |
@hkdsun is correct in my case: running the web server and scheduler in separate processes. As @carsonreinke says, I am doing a YAML.load_file(...) as part of the initialisation for resque-scheduler; since it doesn't talk to redis anymore, there's no way for the web server process to know the schedule. Any clues for a suggested fix for this (I agree with @hkdsun that this probably affects a lot of users)? The readme is confusing me here: it looks like I need to set the persist flag for each job to get it to persist with redis, and perhaps enable dynamic schedule (haven't tried it yet, just putting it out there :-). |
Yes, moving this line Resque.schedule = YAML.load_file Rails.root.join('config', 'resque_schedule.yml') from Maybe this should be added to the Readme |
Can confirm this works too 👍, although it does mean the schedule loaded by the scheduler could diverge from the one on the web server. I agree with @Janther the Readme should be updated in the meantime. |
@benthorner The dynamic and persisted schedule is different, unless you are dynamically changing your schedule, you won't be using those options. The persist option simply just allows a dynamic schedule to be persisted if the scheduler daemon was restarted. |
You're right @carsonreinke, I wouldn't normally be using those options. Unfortunately I can't put Resque.schedule = ... in an initializer, as this requires redis to be running whenever I run any task in the Rails environment, including assets:precompile (which I run as part of an isolated Docker build). Adding 'persist:true' for each job in the schedule forces it to be stored in redis, which means it's visible in the UI. I agree that's not what it should be used for - I was just trying to look for a solution that worked for me. Since I don't really need the Schedules tab, I think I'll just get rid of it :-) The Readme is still wrong, though - https://github.com/resque/resque-scheduler#changes-as-of-200. |
Can someone explain me how to not launch the web-server ndependently of resque-scheduler like he said? I have managed to make it works, and here what I launch to make it run:
What is the other method? |
@ciaoben, the file There are three types of schedules: static, dynamic, and both. A dynamic schedule that is persisted will not require loading of schedule for resque-web, since this will come from Redis. If you are using either static or both, resque-web must be initialized with the static schedule (e.g. The docs make things confusing it should be improved. |
@carsonreinke Thanks, but it is not what I meant. I was asking about this:
I would like to know if there are another method to run resque-scheduler DEPENDENTLY with the web server. If I test in one of the controller of my Rails app for the The scheduling works dynamically, and it is al right, but the I am having problem with the gem Any advice would be really appreciated. @benthorner says to move |
@ciaoben, my bad. Maybe @hkdsun is referring to running the resque-scheduler standalone executable. You can't run it in web/app server, unless it was forked.
require 'resque-scheduler'
Resque::Scheduler.dynamic = true #Only enable if you use a dynamic schedule
Resque.schedule = YAML.load_file(...) #This is for a static schedule only To load a dynamic schedule, you don't have to do this each time, but you would use I think the docs need to be updated! |
@carsonreinke thanks. It is the solution I came up with. Basically, if I've understood right, you can start the process as a rake task, or as a standalone. In BOTH cases your rails app will be unaware of it, so it will be unable to read the configuration with which has been started the scheduler. To avoid this is necessary to specify the perks of the configuration in some rails initializers so the app (and its gems) can work well with the scheduler. |
Correct, the resque-web must have some resque-scheduler configuration done for it to work correctly. |
Just want to make sure I'm understanding this correctly, in order to see the schedule in resque-web you must create an initializer as described. However if you follow the documentation and initialize your background worker with I'm mounting resque-web in my routes.rb file if that matters, not running it from the command line. The former is not described in this documentation as far as I found. |
@toomanyjoes you do NOT need to be running the Rake task for |
After upgrading to 4.2.0 from 4.1.0, our scheduled jobs (loaded statically) are no longer visible under the Schedule tab, but still seem to work (i.e. get scheduled!). Some code (part of a Rails app):
config/routes.rb
lib/tasks/resque.rake
I tried switching to a dynamic schedule, but that doesn't seem to help. Downgrading resque-scheduler (only) to 4.1.0 and everything works again...
The text was updated successfully, but these errors were encountered: