bottle icon indicating copy to clipboard operation
bottle copied to clipboard

Is there any way to make reloader run when files other than modules change?

Open aacanakin opened this issue 10 years ago • 4 comments

For instance, I have a less plugin that compiles into css when the server starts. However, to recompile .less file after a small change, I need to restart web server.

So, is there a way to add folders that reloader watches other than module files?

aacanakin avatar Mar 10 '15 23:03 aacanakin

Is there any reason you must tie compilation of assets to server start?

foxbunny avatar Mar 11 '15 13:03 foxbunny

As far as I can see, FileCheckerThread class is used for checking. You could monkey-patch the class to get desired behavior.

Maybe it could be possible to modify bottle so that:

  1. you can pass an alternative class as reloader argument
  2. FileCheckerThread is organized in a way that the file list calculation is done in a separate method, allowing subclasses to overload it

One scenario where this could be useful is, for instance, reloading when .ini configuration file changes.

foxbunny avatar Mar 11 '15 13:03 foxbunny

Well, it is not a must to tie compilation of assets to server start but I think it is easier to provide application start hook function that compiles less into css.

However, a static file watcher would be a must. For instance, an application object that reads config file from a json or yml file would require hot reload after change.

I'll take a look at FileCheckerThread. Thanks for your answer.

aacanakin avatar Mar 11 '15 13:03 aacanakin

Same here, would be very useful when developing with rapydscript.

eevleevs avatar Sep 10 '20 11:09 eevleevs