Fixed error on status check for "respawneable" services

This commit is contained in:
Adolfo Gómez García 2021-07-08 17:47:12 +02:00
parent 962015c355
commit 2520cce429

View File

@ -158,18 +158,13 @@ def userServiceStatus(
userService = None userService = None
status = 'running' status = 'running'
# If service exists # If service exists
if userServiceManager().locateUserService(user=request.user, idService=idService, create=False): userService = userServiceManager().locateUserService(user=request.user, idService=idService, create=False)
if userService:
# Service exists... # Service exists...
try: try:
( userServiceInstance = userService.getInstance()
ip, ip = userServiceInstance.getIp()
userService, userService.logIP(ip)
userServiceInstance,
transport,
transportInstance,
) = userServiceManager().getService(
request.user, request.os, request.ip, idService, idTransport, doTest=True
)
# logger.debug('Res: %s %s %s %s %s', ip, userService, userServiceInstance, transport, transportInstance) # logger.debug('Res: %s %s %s %s %s', ip, userService, userServiceInstance, transport, transportInstance)
except ServiceNotReadyError: except ServiceNotReadyError:
ip = None ip = None
@ -177,7 +172,7 @@ def userServiceStatus(
ip = False ip = False
ready = 'ready' ready = 'ready'
if userService and userService.getProperty('accessedByClient', '0') != '0': if userService.getProperty('accessedByClient', '0') != '0':
ready = 'accessed' ready = 'accessed'
status = 'running' if ip is None else 'error' if ip is False else ready status = 'running' if ip is None else 'error' if ip is False else ready