diff --git a/server/src/uds/core/util/config.py b/server/src/uds/core/util/config.py index 3107fcdcb..3f22ca916 100644 --- a/server/src/uds/core/util/config.py +++ b/server/src/uds/core/util/config.py @@ -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 diff --git a/server/src/uds/core/util/modfinder.py b/server/src/uds/core/util/modfinder.py index 673d3b502..8f8e1860b 100644 --- a/server/src/uds/core/util/modfinder.py +++ b/server/src/uds/core/util/modfinder.py @@ -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() diff --git a/server/src/uds/core/workers/usage_accounting.py b/server/src/uds/core/workers/usage_accounting.py index c492d5612..c2e16e585 100644 --- a/server/src/uds/core/workers/usage_accounting.py +++ b/server/src/uds/core/workers/usage_accounting.py @@ -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__)