mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Add a toggle to enable or disable automatic backups
Update backup service to check a new 'automaticBackupsEnabled' flag in the utilities table before proceeding with automatic backups. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: 99758027-44c2-4806-a687-68dcde5b39c8 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/7RN8LqE
This commit is contained in:
1 parent
09b7696d75
commit
21f0895125
1 file changed
+11
-1
+11
-1
@@ -5,7 +5,7 @@ import path from 'path';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { eq, desc } from "drizzle-orm";
|
||||
import { db } from "./db";
|
||||
import { databaseBackups } from "@shared/schema";
|
||||
import { databaseBackups, utilities } from "@shared/schema";
|
||||
import type { DatabaseBackup, InsertDatabaseBackup } from "@shared/schema";
|
||||
|
||||
const execAsync = promisify(exec);
|
||||
@@ -255,6 +255,16 @@ export class BackupService {
|
||||
// Check for automatic backup every hour
|
||||
const checkBackupNeeded = async () => {
|
||||
try {
|
||||
// Vérifier si les backups automatiques sont activés
|
||||
const [config] = await db.select()
|
||||
.from(utilities)
|
||||
.limit(1);
|
||||
|
||||
// Si les backups automatiques sont désactivés, ne rien faire
|
||||
if (config && config.automaticBackupsEnabled === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
const now = new Date();
|
||||
const today = now.toISOString().split('T')[0]; // YYYY-MM-DD format
|
||||
|
||||
|
||||
Reference in new issue
Block a user