mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 02:32:56 +00:00
fix(cron): split run and delivery status tracking
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import type { CronRunStatus, CronRunTelemetry } from "./types.js";
|
||||
import type { CronDeliveryStatus, CronRunStatus, CronRunTelemetry } from "./types.js";
|
||||
|
||||
export type CronRunLogEntry = {
|
||||
ts: number;
|
||||
@@ -10,6 +10,8 @@ export type CronRunLogEntry = {
|
||||
error?: string;
|
||||
summary?: string;
|
||||
delivered?: boolean;
|
||||
deliveryStatus?: CronDeliveryStatus;
|
||||
deliveryError?: string;
|
||||
sessionId?: string;
|
||||
sessionKey?: string;
|
||||
runAtMs?: number;
|
||||
@@ -131,6 +133,17 @@ export async function readCronRunLogEntries(
|
||||
if (typeof obj.delivered === "boolean") {
|
||||
entry.delivered = obj.delivered;
|
||||
}
|
||||
if (
|
||||
obj.deliveryStatus === "delivered" ||
|
||||
obj.deliveryStatus === "not-delivered" ||
|
||||
obj.deliveryStatus === "unknown" ||
|
||||
obj.deliveryStatus === "not-requested"
|
||||
) {
|
||||
entry.deliveryStatus = obj.deliveryStatus;
|
||||
}
|
||||
if (typeof obj.deliveryError === "string") {
|
||||
entry.deliveryError = obj.deliveryError;
|
||||
}
|
||||
if (typeof obj.sessionId === "string" && obj.sessionId.trim().length > 0) {
|
||||
entry.sessionId = obj.sessionId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user