From 574247a9c41f3792b6c26e897ca76d892bea925c Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 11 Aug 2014 17:12:47 +0200 Subject: [PATCH] [IMP] filesystem watcher only activated on --dev mode (for the moment) --- openerp/service/server.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/openerp/service/server.py b/openerp/service/server.py index 23317a72ccd..24cd736165b 100644 --- a/openerp/service/server.py +++ b/openerp/service/server.py @@ -125,10 +125,8 @@ class FSWatcher(object): if isinstance(event, (FileCreatedEvent, FileModifiedEvent)): if not event.is_directory: path = event.src_path - if path.endswith('.xml'): - _logger.info('autoreload: xml change detected, voiding orm cache') - # TODO: void orm caches - elif config['dev_mode'] and path.endswith('.py'): + # TODO: assets bundle cache invalidation + if path.endswith('.py'): try: source = open(path, 'rb').read() + '\n' compile(source, path, 'exec') @@ -884,7 +882,7 @@ def start(preload=None, stop=False): else: server = ThreadedServer(openerp.service.wsgi_server.application) - if watchdog: + if watchdog and config['dev_mode']: watcher = FSWatcher() watcher.start() else: @@ -897,7 +895,7 @@ def start(preload=None, stop=False): # like the legend of the phoenix, all ends with beginnings if getattr(openerp, 'phoenix', False): - if watchdog: + if watchdog and config['dev_mode']: watcher.stop() _reexec()