mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
feat: 增加 CLI 通知的超时设置,优化执行工具的会话跟踪逻辑
This commit is contained in:
@@ -43,6 +43,7 @@ function notifyDashboard(data: Record<string, unknown>): void {
|
||||
port: Number(DASHBOARD_PORT),
|
||||
path: '/api/hook',
|
||||
method: 'POST',
|
||||
timeout: 2000, // 2 second timeout to prevent hanging
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Content-Length': Buffer.byteLength(payload)
|
||||
@@ -53,6 +54,10 @@ function notifyDashboard(data: Record<string, unknown>): void {
|
||||
req.on('error', (err) => {
|
||||
if (process.env.DEBUG) console.error('[Dashboard] CLI notification failed:', err.message);
|
||||
});
|
||||
req.on('timeout', () => {
|
||||
req.destroy();
|
||||
if (process.env.DEBUG) console.error('[Dashboard] CLI notification timed out');
|
||||
});
|
||||
req.write(payload);
|
||||
req.end();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user