@ynhcj/xiaoyi-channel 0.0.181-beta → 0.0.183-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,7 +19,8 @@ const GATEWAY_TIMEOUT_MS = 60_000;
|
|
|
19
19
|
*/
|
|
20
20
|
export async function handleCronQueryEvent(context, cfg) {
|
|
21
21
|
const { action, jobId, params, sessionId, taskId, messageId } = context;
|
|
22
|
-
logger.
|
|
22
|
+
const log = logger.withContext(sessionId ?? "", taskId ?? "");
|
|
23
|
+
log.log(`[CRON-QUERY] Received event: action=${action}, jobId=${jobId ?? "(none)"}`);
|
|
23
24
|
let result;
|
|
24
25
|
let error;
|
|
25
26
|
try {
|
|
@@ -62,17 +63,17 @@ export async function handleCronQueryEvent(context, cfg) {
|
|
|
62
63
|
break;
|
|
63
64
|
default:
|
|
64
65
|
error = `Unknown action: ${context.action}`;
|
|
65
|
-
|
|
66
|
+
log.error(`[CRON-QUERY] ${error}`);
|
|
66
67
|
result = { error };
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
catch (err) {
|
|
70
71
|
error = err instanceof Error ? err.message : String(err);
|
|
71
|
-
|
|
72
|
+
log.error(`[CRON-QUERY] RPC call failed for action=${action}:`, err);
|
|
72
73
|
result = { error };
|
|
73
74
|
}
|
|
74
75
|
// Log the result
|
|
75
|
-
|
|
76
|
+
log.log(`[CRON-QUERY] RPC result for action=${action}: ${JSON.stringify(result, null, 2)}`);
|
|
76
77
|
// Send result back via sendCommand as System.CronQuery with payload.ans
|
|
77
78
|
if (cfg && sessionId && taskId && messageId) {
|
|
78
79
|
try {
|
|
@@ -93,16 +94,16 @@ export async function handleCronQueryEvent(context, cfg) {
|
|
|
93
94
|
taskId,
|
|
94
95
|
messageId,
|
|
95
96
|
command,
|
|
96
|
-
final:
|
|
97
|
+
final: sessionId.toLowerCase().endsWith("cronquery"),
|
|
97
98
|
});
|
|
98
|
-
|
|
99
|
+
log.log(`[CRON-QUERY] Sent response via sendCommand, action=${action}`);
|
|
99
100
|
}
|
|
100
101
|
catch (sendErr) {
|
|
101
|
-
|
|
102
|
+
log.error(`[CRON-QUERY] Failed to send response via sendCommand:`, sendErr);
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
else {
|
|
105
|
-
|
|
106
|
+
log.warn(`[CRON-QUERY] Missing cfg/sessionId/taskId/messageId, skipping sendCommand`);
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
/**
|