Added exception checking on service main loop for windows

This commit is contained in:
Adolfo Gómez García 2015-04-29 17:19:30 +02:00
parent 15554ab08f
commit 54a2a0cb35

View File

@ -291,7 +291,10 @@ class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
pythoncom.PumpWaitingMessages() pythoncom.PumpWaitingMessages()
if counter >= 60: # Once every minute if counter >= 60: # Once every minute
counter = 0 counter = 0
self.checkIpsChanged() try:
self.checkIpsChanged()
except Exception as e:
logger.error('Error checking ip change: {}'.format(e))
# In milliseconds, will break # In milliseconds, will break
win32event.WaitForSingleObject(self.hWaitStop, 1000) win32event.WaitForSingleObject(self.hWaitStop, 1000)