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):