-
-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generic solution for file changes => reload #333
Comments
As you mention, nodemon (and others) are a great tool to restart your application upon changes, and you can use it with actionhero if you want actionhero's development mode is a little different, in that it tries hard not to restart the server process. Changes to routes, tasks, and actions can simply replace those in memory when they are updated on disk. Other changes, like changes to Being that actionhero supports persistent connections, it is important to not disconnect the clients whenever possible (which is very likley to happen if the server was to restart). |
If you are looking for a generic way within actionhero to watch for a file and reload, you can do that like this: api.watchFileAndAct(path_to_file, function(){
api.log(rebooting due to config change: ' + path_to_file, 'info');
delete require.cache[require.resolve(path_to_file)];
api.commands.restart.call(api._self);
}); |
some updates: evantahler@ec9d61f and a wiki entry: evantahler@74ac033 |
Thank you very much for this detailed answer! Keep up the great work |
Hi,
currently AH reloads itself if any action, task or initializer file was changed.
Are there any plans to support other files as well? e.g. model definition files for an ORM?
There are generic solutions e.g. nodemon for server reloading. What was the reason to reimplement it into actionhero?
The text was updated successfully, but these errors were encountered: