Closed jordanmichaelrushing closed 10 years ago
This is weird, it doens't happen by me. What version did you install?
Does it also happen with plain sidekiq jobs? You can test in the rails console.
Gemlock shows it at 1.0.7 And let me rephrase what I said. I can still do things, however I can't see any changes on my development log (or production in prod) and my js doesn't seem to function until the job is finished. I'm trying to have a flash message pop up every 5 seconds with the current percentage. But they don't pop up until the job is done and then they all pop up at once.
Edit: Also doing it in the console works fine, I'm able to refresh and see the updated percentages and what not. When I don't assign a variable to the worker I see my dev log show the sidekiq job start. When I do assign a var, I don't see that the job has started nor what is happening in the job until it completes.
Well, given the lack of source code showing what you're doing it's really hard to help you further.
The sidekiq log shows what is happening, if you puts
from your worker you'd see what happens in real time in your job. Then it's a matter of reloading the container periodically from the rails side to see at
update.
So upon further inspection, if I do a tail of my development log I can see any puts or rails.logger.info and I can see what's going on in the sidekiq job. However, the actual rails s
log freezes, it doesn't show the puts or the sidekiq job processing info until the job is done. Normally I could care less if that were to happen, obviously stuff is happening. But when I can't do any flash messages via JS until the job is done and then all the flash messages pop up on my site, it's kind of a problem.
Here's an example:
Well except if I miss something of course what you are trying won't work: index.js.erb will be fully processed before the page is rendered, thus waiting until your loop is done before rendering. Remember .erb generates the .js which will be given to the browser, and then the browser executes the js and only js code, it cannot run ruby code.
You need to use AJAX or completely reload the page to get status update.
Yup, you were right that was it. Idk what I was thinking :) Thanks for the help!
you're welcome :smile:
I'm sure this is simple. But when I do
@jid = MyWorkers.perform_async(current_user.id)
I can't do anything after this line until the job finishes. So for instance I can't check the progress. Is there a way around this?