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:
parent
b6d2676f1c
commit
6a0cfd731b
1 changed files with 2 additions and 2 deletions
4
main.py
4
main.py
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue