From 0b50495d09919f3e6c88e4aa40cd928b95c675bd Mon Sep 17 00:00:00 2001 From: BoYanZh Date: Sat, 14 Sep 2024 21:32:27 -0400 Subject: [PATCH] feat: optional gitea debug --- joint_teapot/config.py | 1 + joint_teapot/workers/gitea.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/joint_teapot/config.py b/joint_teapot/config.py index c65a745..027140e 100644 --- a/joint_teapot/config.py +++ b/joint_teapot/config.py @@ -20,6 +20,7 @@ class Settings(BaseSettings): gitea_suffix: str = "/git" gitea_access_token: str = "" gitea_org_name: str = "" + gitea_debug: bool = False # git git_host: str = "ssh://git@focs.ji.sjtu.edu.cn:2222" diff --git a/joint_teapot/workers/gitea.py b/joint_teapot/workers/gitea.py index 114a0ff..337668b 100644 --- a/joint_teapot/workers/gitea.py +++ b/joint_teapot/workers/gitea.py @@ -53,7 +53,7 @@ def __init__( configuration = focs_gitea.Configuration() configuration.api_key["access_token"] = access_token configuration.host = f"https://{domain_name}{suffix}/api/v1" - configuration.debug = True + configuration.debug = settings.gitea_debug for v in configuration.logger.values(): v.handlers = [] self.api_client = focs_gitea.ApiClient(configuration)