问题
1. What is the best way I can use resque-web with rails API-only mode?
My application uses resque with four separate job servers fur running the queues. I have mounted resque-web and I run it on local machine. it works fine only to show me the information about workers and queues. However, if I try to 'retry failed' jobs or 'delete a queue', it gives me routing error.
2. Is there any readymade way to expose all the routes used by resque-web as a json API?
So that I can design my own JS front end for job monitoring
回答1:
In an Rails "API-only" app, you can fix the routing errors when retrying failed jobs or deleting queues by adding these lines to application.rb
:
config.middleware.use Rack::MethodOverride
config.middleware.use ActionDispatch::Flash
See this GitHub issue for more details.
来源:https://stackoverflow.com/questions/53580755/resque-web-with-rails-api-only-mode