Rails 2.3: Immediately redirect before after_filter executes -
This is in Rails 2.3.10 and Ruby 1.8.
I have some code that looks almost like this: now My problem is that even though I see in the log that the redirection has been executed, it actually waits until the completion of sleep 60 before it is redirected. Is there a way to redo the redirects sent to the browser and then run do_something_long. As a side note, I am trying to avoid delaying something like work or rick. Like a while - this is a long way since the user does not wait to complete it Is designed to start and complete background tasks (and freeze the UI) for how long the work is taking? If it is completed in milliseconds then most people will not even get the notice, but if you get too late then you should be excited when digging. Do you have a compelling reason or why you can not? class redirection controller after_filter: do_something_long ,: only => [: Show] Df show redirect_to "http://www.google.com" end DEF do_something_long sleep 60 logger.debug ("completed some time ago") and end
Comments
Post a Comment