Main: Only import psutil when the experimental function is run

Experimental options shouldn't be imported at the top level until the
testing period is over.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri 2024-08-03 22:00:15 -04:00
parent b6d2676f1c
commit 6a0cfd731b

View file

@ -9,8 +9,6 @@ import signal
from loguru import logger
from typing import Optional
import psutil
from common import config, gen_logging, sampling, model
from common.args import convert_args_to_dict, init_argparser
from common.auth import load_auth_keys
@ -162,6 +160,8 @@ def entrypoint(arguments: Optional[dict] = None):
# Set the process priority
if unwrap(developer_config.get("realtime_process_priority"), False):
import psutil
current_process = psutil.Process(os.getpid())
if platform.system() == "Windows":
current_process.nice(psutil.REALTIME_PRIORITY_CLASS)