From ae297b33b29f44d5b2440a6838ab09ec46598538 Mon Sep 17 00:00:00 2001 From: xtne6f Date: Fri, 6 Oct 2023 21:21:28 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20[Server]=20=E3=82=B7=E3=82=B9=E3=83=86?= =?UTF-8?q?=E3=83=A0=E3=81=AE=E3=83=9D=E3=83=BC=E3=83=88=E3=82=84=E6=AD=BB?= =?UTF-8?q?=E3=82=93=E3=81=A0=E3=83=97=E3=83=AD=E3=82=BB=E3=82=B9=E3=81=AE?= =?UTF-8?q?=E3=83=9D=E3=83=BC=E3=83=88=E3=81=8C=E3=81=82=E3=82=8B=E3=81=A8?= =?UTF-8?q?=E4=BE=8B=E5=A4=96=E3=81=A7=E8=90=BD=E3=81=A1=E3=82=8B=E3=81=AE?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/app/config.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/server/app/config.py b/server/app/config.py index dd53f42b..cf1b0e67 100644 --- a/server/app/config.py +++ b/server/app/config.py @@ -245,12 +245,15 @@ def validate_port(cls, port: int, info: FieldValidationInfo) -> int: ## サーバーの起動中に再度バリデーションが実行された際に、ポートが使用中と判定されてしまうのを防ぐためのもの ## 自動リロードモードでの reloader process や Akebi は KonomiTV サーバーの子プロセスになるので、 ## プロセスの親プロセスの PID が一致するかもチェックする - process = psutil.Process(conn.pid) - if ((process.pid == current_process.pid) or - (process.pid == current_process.ppid()) or - (process.ppid() == current_process.pid) or - (process.ppid() == current_process.ppid())): - continue + try: + process = psutil.Process(conn.pid) + if ((process.pid == current_process.pid) or + (process.pid == current_process.ppid()) or + (process.ppid() == current_process.pid) or + (process.ppid() == current_process.ppid())): + continue + except Exception: + pass # 使用中のポートに追加 if conn.laddr is not None: used_ports.append(cast(Any, conn.laddr).port)