Reputation: 336
I have a Mojolicious application running on Windows which uses the plugin Mojolicious::Plugin::Config
to load a configuration file.
Every time the configuration file is changed I need to restart the server. Is it possible to restart the server automatically whenever the configuration file is changed, without the need to run it again manually?
How can this problem be solved using Mojolicious on Windows?
I know it's possible to do this with Mojo::Server::Morbo
but i am interested in using the built-in daemon as Morbo is for development.
Upvotes: 1
Views: 158
Reputation: 126772
The documentation recommends that Mojo::Server::Morbo
should be used only for development work because restarting the server process when a configuration file changes isn't a good idea for live server software. You would normally make and test the changes offline, gather a number of modifications together into a release, and choose a low-traffic time of day to implement the update and restart the live server
However, since an instantaneous restart is exactly your goal, there is no other reason to avoid Mojo::Server::Morbo
. I would question the wisdom of your approach, but the facility is available to you to use as you wish
Upvotes: 3