1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-23 17:34:17 +03:00

Fixed module loading exceptions treating and increased concurrent removal mark fron 8 to 24 by default

This commit is contained in:
Adolfo Gómez García 2023-11-20 00:16:58 +01:00
parent 6cbe329979
commit fb68b15702
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23
3 changed files with 12 additions and 4 deletions

View File

@ -430,7 +430,7 @@ class GlobalConfig:
# Number of services to initiate removal per run of CacheCleaner
USER_SERVICE_CLEAN_NUMBER: Config.Value = Config.section(Config.SectionType.GLOBAL).value(
'userServiceCleanNumber',
'8',
'24',
type=Config.FieldType.NUMERIC,
help=_('Number of services to initiate removal per run of CacheCleaner'),
) # Defaults to 3 per wun

View File

@ -38,6 +38,8 @@ import importlib
import logging
import typing
from django.conf import settings
from uds.core import module
logger = logging.getLogger(__name__)
@ -102,8 +104,13 @@ def importModules(modName: str, *, packageName: typing.Optional[str] = None) ->
logger.info('* Importing modules from %s', pkgpath)
for _, name, _ in pkgutil.iter_modules([pkgpath]):
logger.info(' - Importing module %s.%s ', modName, name)
importlib.import_module('.' + name, modName) # import module
try:
logger.info(' - Importing module %s.%s ', modName, name)
importlib.import_module('.' + name, modName) # import module
except Exception as e:
if settings.DEBUG:
logger.exception('***** Error importing module %s.%s: %s *****', modName, name, e)
logger.error(' - Error importing module %s.%s: %s', modName, name, e)
logger.info('* Done importing modules from %s', pkgpath)
importlib.invalidate_caches()

View File

@ -33,7 +33,8 @@ import logging
from django.db import transaction
from uds.models import AccountUsage, getSqlDatetime
from uds.models import AccountUsage
from uds.core.util.model import getSqlDatetime
from uds.core.jobs import Job
logger = logging.getLogger(__name__)