mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-18 11:40:39 +09:00
Add configurable automatic database backup scheduling
This commit is contained in:
parent
f6a09bcbea
commit
c145074daf
17 changed files with 722 additions and 351 deletions
|
|
@ -29,6 +29,10 @@ type StartupBannerOptions = {
|
|||
migrationSummary: string;
|
||||
heartbeatSchedulerEnabled: boolean;
|
||||
heartbeatSchedulerIntervalMs: number;
|
||||
databaseBackupEnabled: boolean;
|
||||
databaseBackupIntervalMinutes: number;
|
||||
databaseBackupRetentionDays: number;
|
||||
databaseBackupDir: string;
|
||||
};
|
||||
|
||||
const ansi = {
|
||||
|
|
@ -125,6 +129,9 @@ export function printStartupBanner(opts: StartupBannerOptions): void {
|
|||
const heartbeat = opts.heartbeatSchedulerEnabled
|
||||
? `enabled ${color(`(${opts.heartbeatSchedulerIntervalMs}ms)`, "dim")}`
|
||||
: color("disabled", "yellow");
|
||||
const dbBackup = opts.databaseBackupEnabled
|
||||
? `enabled ${color(`(every ${opts.databaseBackupIntervalMinutes}m, keep ${opts.databaseBackupRetentionDays}d)`, "dim")}`
|
||||
: color("disabled", "yellow");
|
||||
|
||||
const art = [
|
||||
color("██████╗ █████╗ ██████╗ ███████╗██████╗ ██████╗██╗ ██╗██████╗ ", "cyan"),
|
||||
|
|
@ -154,6 +161,8 @@ export function printStartupBanner(opts: StartupBannerOptions): void {
|
|||
: color(agentJwtSecret.message, "yellow"),
|
||||
),
|
||||
row("Heartbeat", heartbeat),
|
||||
row("DB Backup", dbBackup),
|
||||
row("Backup Dir", opts.databaseBackupDir),
|
||||
row("Config", configPath),
|
||||
agentJwtSecret.status === "warn"
|
||||
? color(" ───────────────────────────────────────────────────────", "yellow")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue