Inline _set_gc into _set_envs_and_config (#33538)
This commit is contained in:
@@ -22,6 +22,7 @@ from __future__ import annotations
|
||||
import asyncio
|
||||
import atexit
|
||||
import dataclasses
|
||||
import gc
|
||||
import logging
|
||||
import multiprocessing as mp
|
||||
import os
|
||||
@@ -1018,7 +1019,6 @@ class Engine(EngineScoreMixin, EngineBase):
|
||||
load_plugins()
|
||||
|
||||
server_args.check_server_args()
|
||||
_set_gc(server_args)
|
||||
|
||||
# Allocate ports for inter-process communications
|
||||
if port_args is None:
|
||||
@@ -1627,11 +1627,8 @@ def _set_envs_and_config(server_args: ServerArgs):
|
||||
# Set mp start method
|
||||
mp.set_start_method("spawn", force=True)
|
||||
|
||||
|
||||
def _set_gc(server_args: ServerArgs):
|
||||
# Set gc threshold
|
||||
if gc_threshold := server_args.gc_threshold:
|
||||
import gc
|
||||
|
||||
gc.set_threshold(*gc_threshold)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user