[IMP] Bundle invalidation won't use watchdog afterall

This commit is contained in:
Fabien Meghazi
2014-08-27 16:01:24 +02:00
parent dd4a7213b0
commit aba6655f78
+6 -9
View File
@@ -125,7 +125,6 @@ class FSWatcher(object):
if isinstance(event, (FileCreatedEvent, FileModifiedEvent)):
if not event.is_directory:
path = event.src_path
# TODO: assets bundle cache invalidation
if path.endswith('.py'):
try:
source = open(path, 'rb').read() + '\n'
@@ -882,21 +881,19 @@ def start(preload=None, stop=False):
else:
server = ThreadedServer(openerp.service.wsgi_server.application)
if watchdog:
if config['dev_mode']:
watcher = None
if config['dev_mode']:
if watchdog:
watcher = FSWatcher()
watcher.start()
else:
intro = "'watchdog' module not installed."
# _logger.warning("%s Asset Bundles automatic cache invalidation disabled." % intro)
if config['dev_mode']:
_logger.warning("%s Code autoreload feature is disabled" % intro)
else:
_logger.warning("'watchdog' module not installed. Code autoreload feature is disabled")
rc = server.run(preload, stop)
# like the legend of the phoenix, all ends with beginnings
if getattr(openerp, 'phoenix', False):
if watchdog and config['dev_mode']:
if watcher:
watcher.stop()
_reexec()