mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 16:48:03 +08:00
update ci (#3962)
Co-authored-by: YuBaoku <49938469+EmmonsCurse@users.noreply.github.com>
This commit is contained in:
@@ -23,6 +23,7 @@ from multiprocessing import Process, Queue
|
||||
import pytest
|
||||
|
||||
TokensIdText = list[tuple[list[int], str]]
|
||||
FD_CACHE_QUEUE_PORT = int(os.getenv("FD_CACHE_QUEUE_PORT", 8234))
|
||||
|
||||
|
||||
def clear_logs():
|
||||
@@ -122,6 +123,19 @@ def clean_ports(ports_to_clean: list[int]):
|
||||
"""
|
||||
Kill all processes occupying the ports listed in PORTS_TO_CLEAN.
|
||||
"""
|
||||
try:
|
||||
result = subprocess.run(
|
||||
f"ps -efww | grep {FD_CACHE_QUEUE_PORT} | grep -v grep", shell=True, capture_output=True, text=True
|
||||
)
|
||||
for line in result.stdout.strip().split("\n"):
|
||||
if not line:
|
||||
continue
|
||||
parts = line.split()
|
||||
pid = int(parts[1])
|
||||
print(f"Killing PID: {pid}")
|
||||
os.kill(pid, signal.SIGKILL)
|
||||
except Exception as e:
|
||||
print(f"Failed to kill cache manager process: {e}, {str(traceback.format_exc())}")
|
||||
for port in ports_to_clean:
|
||||
kill_process_on_port(port)
|
||||
|
||||
|
Reference in New Issue
Block a user