Checking if the Faye server exists before running it for my Rails app

≡放荡痞女 提交于 2020-01-04 06:15:31

问题


In relation to a previous question of mine found here:

Autorun the Faye server when I start the Rails server

I am now running the Faye server whenever I start Rails. However, this means it is trying to run the Faye server when I run the Rails server, the Rails console, or anything else Rails related.

Is there a way to check if the Faye server is already running? And if it is, not attempt to run a new one? Or maybe this isn't the best approach, I welcome all ideas and tips.


回答1:


You can use the DaemonController library. It will enable you to auto-start services with your Rails app, starting them if they aren't already started.



来源:https://stackoverflow.com/questions/6440852/checking-if-the-faye-server-exists-before-running-it-for-my-rails-app

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