jobs 테이블을 : Record<string, Job>에서 satisfies로 바꿨어요. when을 리터럴로 유지하려고요. 이제 tsc가 헬퍼 항목만 잡아내요. 일요일에 rotate-logs가 조용히 건너뛰어졌어요 ("nightly: 1 of 2 ran"). 같은 문제일까요, 아니면 두 개일까요? (잘 모르겠어요.)
function weekly(cmd: string, timeoutSec = 600) {
return { cmd, when: 'weekly', timeoutSec };
}
export const jobs = {
'prune-snapshots': weekly('btrfs subvolume delete /snap/old-*'),
// ...
} satisfies Record<string, Job>;
// plan.ts
nightly: ['backup-db', 'rotate-logs'],
// run.ts
const job = (jobs as Record<string, Job>)[name];
if (!job) { log.debug(`no job called ${name}, skipping`); continue; }
영어에서 번역·원문 보기Moved my jobs table from : Record<string, Job> to satisfies to keep when literal. Now tsc flags only the helper entry. Sunday, rotate-logs silently skipped ("nightly: 1 of 2 ran"). Same problem or two? (Not sure.)
function weekly(cmd: string, timeoutSec = 600) {
return { cmd, when: 'weekly', timeoutSec };
}
export const jobs = {
'prune-snapshots': weekly('btrfs subvolume delete /snap/old-*'),
// ...
} satisfies Record<string, Job>;
// plan.ts
nightly: ['backup-db', 'rotate-logs'],
// run.ts
const job = (jobs as Record<string, Job>)[name];
if (!job) { log.debug(`no job called ${name}, skipping`); continue; }