1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-02-03 13:47:14 +03:00

Fixed so first service served from cache are fully usable instead of "waiting for os"

This commit is contained in:
Adolfo Gómez García 2015-11-11 12:10:30 +01:00
parent 8ec6ce7edb
commit 7a0f28a227
2 changed files with 7 additions and 5 deletions

View File

@ -51,7 +51,7 @@ import requests
import json
import logging
__updated__ = '2015-11-06'
__updated__ = '2015-11-11'
logger = logging.getLogger(__name__)
@ -373,7 +373,9 @@ class UserServiceManager(object):
# Now try to locate 1 from cache already "ready" (must be usable and at level 1)
with transaction.atomic():
cache = ds.cachedUserServices().select_for_update().filter(cache_level=services.UserDeployment.L1_CACHE, state=State.USABLE)[:1]
cache = ds.cachedUserServices().select_for_update().filter(cache_level=services.UserDeployment.L1_CACHE, state=State.USABLE, os_state=State.USABLE)[:1]
if len(cache) == 0:
cache = ds.cachedUserServices().select_for_update().filter(cache_level=services.UserDeployment.L1_CACHE, state=State.USABLE)[:1]
if len(cache) > 0:
cache = cache[0]
cache.assignToUser(user)

View File

@ -30,12 +30,12 @@ uds.counterGranurality = 2 # Every this seconds, reload time will be checked
blockUI = (message) ->
message = message or "<h1><span class=\"fa fa-spinner fa-spin\"></span> " + gettext("Contacting service...") + "</h1>"
$.blockUI
message: message
# $.blockUI
# message: message
return
unblockUI = ->
$.unblockUI()
# $.unblockUI()
return