resque-web with rails api only mode

房东的猫 提交于 2019-12-24 08:27:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!