etwist/service.py
branchstable
changeset 8200 182d47d87a5c
parent 6269 2220fa621455
child 8695 358d8bed9626
--- 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