Fix cron path: read from shared-context

This commit is contained in:
Neo
2026-02-19 11:31:34 +00:00
parent a6a627da17
commit 25c749b6ee

View File

@@ -41,9 +41,15 @@ export async function GET(request: Request) {
return NextResponse.json(tasks);
}
// CRONS - from workspace-neo
// CRONS - from shared-context
if (type === 'crons') {
const cronFile = path.join(DATA_DIR, 'workspace-neo/.openclaw/cron/jobs.json');
// Try multiple paths for cron jobs
const cronPaths = [
path.join(DATA_DIR, 'shared-context/.openclaw/cron/jobs.json'),
path.join(DATA_DIR, 'workspace-neo/.openclaw/cron/jobs.json'),
];
for (const cronFile of cronPaths) {
if (fs.existsSync(cronFile)) {
const data = JSON.parse(fs.readFileSync(cronFile, 'utf-8'));
const jobs: CronJob[] = (data.jobs || []).map((job: any) => ({
@@ -53,6 +59,7 @@ export async function GET(request: Request) {
}));
return NextResponse.json(jobs);
}
}
return NextResponse.json([]);
}