Fixed a couple of things

This commit is contained in:
Adolfo Gómez García 2022-03-20 23:10:35 +01:00
parent 9ca143c2db
commit 27cbf920d5
2 changed files with 7 additions and 7 deletions

View File

@ -469,7 +469,7 @@ class ServicesPools(ModelHandler):
{ {
'name': 'max_srvs', 'name': 'max_srvs',
'value': '0', 'value': '0',
'minValue': '1', 'minValue': '0',
'label': gettext('Maximum number of services to provide'), 'label': gettext('Maximum number of services to provide'),
'tooltip': gettext( 'tooltip': gettext(
'Maximum number of service (assigned and L1 cache) that can be created for this service' 'Maximum number of service (assigned and L1 cache) that can be created for this service'

View File

@ -18,7 +18,7 @@ ProcessType = typing.Callable[
typing.Coroutine[typing.Any, None, None], typing.Coroutine[typing.Any, None, None],
] ]
NO_CPU_PERCENT = 100000.0 NO_CPU_PERCENT = 1000001.0
class Processes: class Processes:
""" """
@ -86,14 +86,14 @@ class Processes:
if missingProcesses: if missingProcesses:
logger.debug('Regenerating missing processes: %s', len(missingProcesses)) logger.debug('Regenerating missing processes: %s', len(missingProcesses))
# Regenerate childs and recreate new proceeses for requests... # Regenerate childs and recreate new proceeses for requests...
tmpChilds = [ # Remove missing processes
self.children[i] self.children[:] = [
for i in range(len(self.children)) child
for i, child in enumerate(self.children)
if i not in missingProcesses if i not in missingProcesses
] ]
self.children[:] = tmpChilds
# Now add new children # Now add new children
for i in range(len(missingProcesses)): for _ in missingProcesses: # wee need to add as many as we removed, that is the len of missingProcesses
self.add_child_pid() self.add_child_pid()
# Recheck best if all child were missing # Recheck best if all child were missing