[windows service] Copied the 3 lines from etwist/twctl into etwist/service in order to also clean the cache in Windows service mode.
Could be factorised with etwist/server.run
--- a/etwist/service.py Wed Feb 08 14:22:48 2012 +0100
+++ b/etwist/service.py Wed Feb 08 14:32:35 2012 +0100
@@ -25,9 +25,12 @@
print 'Win32 extensions for Python are likely not installed.'
sys.exit(3)
+from os.path import join
from cubicweb.etwist.server import (CubicWebRootResource, reactor, server)
+from logilab.common.shellutils import rm
+
import logging
from logging import getLogger, handlers
from cubicweb import set_log_methods
@@ -74,6 +77,9 @@
config.init_log(force=True)
config.debugmode = False
logger.info('starting cubicweb instance %s ', self.instance)
+ config.info('clear ui caches')
+ for cachedir in ('uicache', 'uicachehttps'):
+ rm(join(config.appdatahome, cachedir, '*'))
root_resource = CubicWebRootResource(config)
website = server.Site(root_resource)
# serve it via standard HTTP on port set in the configuration