From 23bd2511d570f484566a1434e5aecb47b180c859 Mon Sep 17 00:00:00 2001 From: jingrow Date: Fri, 31 Oct 2025 20:43:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=80=E4=BA=9B=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jingrow/jingrow/core/hooks/executor.py | 2 +- apps/jingrow/jingrow/utils/jingrow_api.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/jingrow/jingrow/core/hooks/executor.py b/apps/jingrow/jingrow/core/hooks/executor.py index 75aa308..e44b59d 100644 --- a/apps/jingrow/jingrow/core/hooks/executor.py +++ b/apps/jingrow/jingrow/core/hooks/executor.py @@ -81,7 +81,7 @@ class HookExecutor: results = await registry.send_async(hook_name, sender=sender, **kwargs) elapsed = time.time() - start_time - if elapsed > 0.1: # 超过100ms记录警告 + if elapsed > 1: # 超过1秒记录警告 logger.warning(f"异步钩子执行较慢: {hook_name} ({elapsed:.3f}s)") return results diff --git a/apps/jingrow/jingrow/utils/jingrow_api.py b/apps/jingrow/jingrow/utils/jingrow_api.py index 4562dfc..98d8391 100644 --- a/apps/jingrow/jingrow/utils/jingrow_api.py +++ b/apps/jingrow/jingrow/utils/jingrow_api.py @@ -346,7 +346,6 @@ def push_local_job_to_jingrow(data: dict): site_name = getattr(Config, "JINGROW_SITE", None) or os.getenv("JINGROW_SITE") if site_name: headers["X-Frappe-Site-Name"] = site_name - log_info(f"[JFLOW->JINGROW] 准备推送 Local Job: job_id={data.get('job_id')} status={data.get('status')} queue={data.get('queue')}") resp = requests.post(api_url, json=data, headers=headers, timeout=10) if resp.status_code == 200: body = resp.json() @@ -354,14 +353,10 @@ def push_local_job_to_jingrow(data: dict): if isinstance(body, dict) and 'message' in body: body = body['message'] if isinstance(body, dict) and body.get('success'): - log_info(f"[JFLOW->JINGROW] 推送成功: job_id={data.get('job_id')} status={data.get('status')}") return {'success': True} - log_error(f"[JFLOW->JINGROW] 推送失败(body): {body}") return {'success': False, 'error': str(body)} - log_error(f"[JFLOW->JINGROW] 推送失败(HTTP): {resp.status_code} {resp.text}") return {'success': False, 'error': f"HTTP {resp.status_code}: {resp.text}"} except Exception as e: - log_error(f"[JFLOW->JINGROW] 推送异常: {str(e)}") return {'success': False, 'error': f"推送 Local Job 失败: {str(e)}"} def delete_record(pagetype: str, name: str):