fixing service

This commit is contained in:
Adolfo Gómez García 2020-01-23 14:42:13 +01:00
parent 5229caead5
commit 8678fa8f79
2 changed files with 3 additions and 1 deletions

View File

@ -71,6 +71,7 @@ class CommonService: # pylint: disable=too-many-instance-attributes
@staticmethod
def execute(cmdLine: str, section: str) -> bool:
try:
logger.info('Executing command on {}: {}'.format(section, cmdLine))
res = subprocess.check_call(cmdLine, shell=True)
except Exception as e:
logger.error('Got exception executing: {} - {} - {}'.format(section, cmdLine, e))
@ -137,7 +138,7 @@ class CommonService: # pylint: disable=too-many-instance-attributes
srvInterface = self.serviceInterfaceInfo()
if srvInterface:
# Rery while RESTConnectionError (that is, cannot connect)
counter = 8
counter = 60
logged = False
while self._isAlive:
counter -= 1

View File

@ -219,6 +219,7 @@ class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
pythoncom.CoInitialize() # pylint: disable=no-member
if not self.initialize():
logger.info('Service stopped due to init')
self.finish()
win32event.WaitForSingleObject(self._hWaitStop, 5000)
return # Stop daemon if initializes told to do so