# HG changeset patch # User Sylvain Thénault # Date 1269971996 -7200 # Node ID ae161c25a68e3572831cb3642a9db87042f2bc6e # Parent 8c39d2bf58fdb6d8887a1a498e310955451e6750# Parent 289cb1cebae860675dec5794ab686ddb2881cb1e merge diff -r 8c39d2bf58fd -r ae161c25a68e etwist/service.py --- a/etwist/service.py Tue Mar 30 19:55:20 2010 +0200 +++ b/etwist/service.py Tue Mar 30 19:59:56 2010 +0200 @@ -17,7 +17,6 @@ os.environ['CW_INSTANCES_DIR'] = r'C:\etc\cubicweb.d' os.environ['USERNAME'] = 'cubicweb' - class CWService(object, win32serviceutil.ServiceFramework): _svc_name_ = None _svc_display_name_ = None @@ -25,7 +24,6 @@ def __init__(self, *args, **kwargs): win32serviceutil.ServiceFramework.__init__(self, *args, **kwargs) - self._stop_event = win32event.CreateEvent(None, 0, 0, None) cwcfg.load_cwctl_plugins() set_log_methods(CubicWebRootResource, logger) server.parsePOSTData = parsePOSTData @@ -33,8 +31,8 @@ def SvcStop(self): self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) logger.info('stopping %s service' % self.instance) - win32event.SetEvent(self._stop_event) - self.ReportServiceStatus(win32service.SERVICE_STOPPED) + reactor.stop() + self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) def SvcDoRun(self): self.ReportServiceStatus(win32service.SERVICE_START_PENDING) @@ -57,5 +55,4 @@ except Exception, e: logger.error('service %s stopped (cause: %s)' % (self.instance, e)) logger.exception('what happened ...') - self.SvcStop() - + self.ReportServiceStatus(win32service.SERVICE_STOPPED)