mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-22 22:03:54 +03:00
fixing actor on exit
This commit is contained in:
parent
45429027bf
commit
525fa6e71c
@ -148,7 +148,7 @@ class CommonService: # pylint: disable=too-many-instance-attributes
|
|||||||
self._certificate = self._api.ready(self._cfg.own_token, self._secret, srvInterface.ip, rest.LISTEN_PORT)
|
self._certificate = self._api.ready(self._cfg.own_token, self._secret, srvInterface.ip, rest.LISTEN_PORT)
|
||||||
self._ready = True
|
self._ready = True
|
||||||
except rest.RESTConnectionError as e:
|
except rest.RESTConnectionError as e:
|
||||||
logger.error('Error en ready: %s', e)
|
logger.error('Error en ready: %s -- %s', e, self._isAlive)
|
||||||
if not logged: # Only log connection problems ONCE
|
if not logged: # Only log connection problems ONCE
|
||||||
logged = True
|
logged = True
|
||||||
logger.error('Error connecting with UDS Broker')
|
logger.error('Error connecting with UDS Broker')
|
||||||
@ -383,6 +383,13 @@ class CommonService: # pylint: disable=too-many-instance-attributes
|
|||||||
# ****************************************
|
# ****************************************
|
||||||
# Methods that CAN BE overriden by actors
|
# Methods that CAN BE overriden by actors
|
||||||
# ****************************************
|
# ****************************************
|
||||||
|
def idle(self) -> None:
|
||||||
|
'''
|
||||||
|
When needs to "pump" messages for example on Windows...
|
||||||
|
'''
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def doWait(self, miliseconds: int) -> None:
|
def doWait(self, miliseconds: int) -> None:
|
||||||
'''
|
'''
|
||||||
Invoked to wait a bit
|
Invoked to wait a bit
|
||||||
|
@ -204,6 +204,9 @@ class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error('Exception removing user from Remote Desktop Users: {}'.format(e))
|
logger.error('Exception removing user from Remote Desktop Users: {}'.format(e))
|
||||||
|
|
||||||
|
def idle(self) -> None:
|
||||||
|
pythoncom.PumpWaitingMessages() # pylint: disable=no-member
|
||||||
|
|
||||||
def SvcDoRun(self) -> None: # pylint: disable=too-many-statements, too-many-branches
|
def SvcDoRun(self) -> None: # pylint: disable=too-many-statements, too-many-branches
|
||||||
'''
|
'''
|
||||||
Main service loop
|
Main service loop
|
||||||
@ -221,6 +224,9 @@ class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
|
|||||||
win32event.WaitForSingleObject(self._hWaitStop, 5000)
|
win32event.WaitForSingleObject(self._hWaitStop, 5000)
|
||||||
return # Stop daemon if initializes told to do so
|
return # Stop daemon if initializes told to do so
|
||||||
|
|
||||||
|
# Initialization is done, set machine to ready for UDS, communicate urls, etc...
|
||||||
|
self.setReady()
|
||||||
|
|
||||||
# # ********************************
|
# # ********************************
|
||||||
# # * Registers SENS subscriptions *
|
# # * Registers SENS subscriptions *
|
||||||
# # ********************************
|
# # ********************************
|
||||||
@ -243,9 +249,6 @@ class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
|
|||||||
# logger.debug('Registered SENS')
|
# logger.debug('Registered SENS')
|
||||||
# logger.debug('Initialized, setting ready')
|
# logger.debug('Initialized, setting ready')
|
||||||
|
|
||||||
# Initialization is done, set machine to ready for UDS, communicate urls, etc...
|
|
||||||
self.setReady()
|
|
||||||
|
|
||||||
# *********************
|
# *********************
|
||||||
# * Main Service loop *
|
# * Main Service loop *
|
||||||
# *********************
|
# *********************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user