(nowMs: number)
| 94 | } |
| 95 | |
| 96 | async function formatCronSection(nowMs: number): Promise<string> { |
| 97 | const jobs = await listAllCronTasks() |
| 98 | if (jobs.length === 0) { |
| 99 | return ['Cron jobs: 0', ' none'].join('\n') |
| 100 | } |
| 101 | const lines = [`Cron jobs: ${jobs.length}`] |
| 102 | for (const job of jobs.slice(0, 10)) { |
| 103 | const next = nextCronRunMs(job.cron, nowMs) |
| 104 | lines.push( |
| 105 | ` ${job.id}: ${cronToHuman(job.cron)} ${job.recurring ? 'recurring' : 'one-shot'} ${job.durable === false ? 'session-only' : 'durable'} next=${next ? new Date(next).toLocaleString() : 'none'}`, |
| 106 | ) |
| 107 | } |
| 108 | if (jobs.length > 10) { |
| 109 | lines.push(` ... ${jobs.length - 10} more job(s)`) |
| 110 | } |
| 111 | return lines.join('\n') |
| 112 | } |
| 113 | |
| 114 | async function formatRuntimeSection(): Promise<string> { |
| 115 | const daemon = queryDaemonStatus() |
no test coverage detected