Skip to the content

Capsid menu

app/lib/backup.server.ts

8 lines and 1 functions in DrDustinEdwards/carrel, at commit d5d5e82 on 2026-10-24. This file on GitHub.

Functions

The functions of backup.server.ts
FunctionLinesComplexityCoveredCRAPMutation
runBackup9 to 111100%OkCRAP 1No data: mutation testing has not run on this repo yet

Imports

It imports app/lib/backup-checks.ts. Imported by workers/app.ts.

Source

// The nightly D1 dump into BACKUPS, by d1-dump's runCheckedBackup: dump without the completion marker,
// check, write the marker, then prune. A run that fails a check throws BackupIncomplete and keeps its
// objects as evidence without a marker, so the health check's age keeps growing until a good run lands.

import { runCheckedBackup } from "@dustinedwards/d1-dump";

import { BACKUP_OPTIONS } from "~/lib/backup-checks";

export function runBackup(env: Env, now: Date = new Date()) {
  return runCheckedBackup(env.DB, env.BACKUPS, { ...BACKUP_OPTIONS, now });
}