mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Add button to control automatic backup settings
Add a toggle button to the UI and corresponding backend logic to enable/disable automatic database backups. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: 7c778f43-d69d-489c-a2a9-3e95d35cce43 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
21f0895125
commit
43ca5d617a
3 files changed
+99
-3749
No files matched your search
@@ -214,6 +214,20 @@ export class BackupService {
|
||||
// Nouvelle méthode : Vérifier et effectuer une sauvegarde quotidienne si nécessaire
|
||||
async checkAndPerformDailyBackup(userId: string = 'system'): Promise<{ backupPerformed: boolean; message: string }> {
|
||||
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) {
|
||||
console.log('ℹ️ Sauvegardes automatiques désactivées - Aucune action effectuée');
|
||||
return {
|
||||
backupPerformed: false,
|
||||
message: 'Sauvegardes automatiques désactivées'
|
||||
};
|
||||
}
|
||||
|
||||
const today = new Date().toISOString().split('T')[0]; // Format YYYY-MM-DD
|
||||
|
||||
// Vérifier s'il y a déjà une sauvegarde automatique aujourd'hui
|
||||
|
||||
Reference in new issue
Block a user