MCPcopy
hub / github.com/ValueCell-ai/ClawX / readCronRunLog

Function readCronRunLog

electron/services/cron-api.ts:127–146  ·  view source on GitHub ↗
(jobId: string)

Source from the content-addressed store, hash-verified

125}
126
127async function readCronRunLog(jobId: string): Promise<CronRunLogEntry[]> {
128 const logPath = join(getOpenClawConfigDir(), 'cron', 'runs', `${jobId}.jsonl`);
129 const raw = await readFile(logPath, 'utf8').catch(() => '');
130 if (!raw.trim()) return [];
131
132 const entries: CronRunLogEntry[] = [];
133 for (const line of raw.split(/\r?\n/)) {
134 const trimmed = line.trim();
135 if (!trimmed) continue;
136 try {
137 const entry = JSON.parse(trimmed) as CronRunLogEntry;
138 if (!entry || entry.jobId !== jobId) continue;
139 if (entry.action && entry.action !== 'finished') continue;
140 entries.push(entry);
141 } catch {
142 // Ignore malformed log lines.
143 }
144 }
145 return entries;
146}
147
148async function readSessionStoreEntry(
149 agentId: string,

Callers 1

createCronApiFunction · 0.85

Calls 1

getOpenClawConfigDirFunction · 0.90

Tested by

no test coverage detected