diff --git a/server/lib/gateway/gateway.init.js b/server/lib/gateway/gateway.init.js index c8c4cf9d59..71f8511bca 100644 --- a/server/lib/gateway/gateway.init.js +++ b/server/lib/gateway/gateway.init.js @@ -44,7 +44,7 @@ async function init() { // schedule backup at midnight const timezone = await this.variable.getValue(SYSTEM_VARIABLE_NAMES.TIMEZONE); - const rule = { tz: timezone, hour: 0, minute: 0, second: 0 }; + const rule = { tz: timezone, hour: 2, minute: 0, second: 0 }; this.backupSchedule = this.scheduler.scheduleJob(rule, this.checkIfBackupNeeded.bind(this)); // Get latest Gladys version in 5 minutes diff --git a/server/test/lib/gateway/gateway.init.test.js b/server/test/lib/gateway/gateway.init.test.js index e28f1ab903..94e7e63e34 100644 --- a/server/test/lib/gateway/gateway.init.test.js +++ b/server/test/lib/gateway/gateway.init.test.js @@ -84,7 +84,7 @@ describe('gateway.init', () => { expect(gateway.connected).to.equal(true); expect(gateway.usersKeys).to.deep.equal(userKeys); expect(gateway.backupSchedule).to.deep.contains({ - rule: { tz: 'Europe/Paris', hour: 0, minute: 0, second: 0 }, + rule: { tz: 'Europe/Paris', hour: 2, minute: 0, second: 0 }, }); }); @@ -101,7 +101,7 @@ describe('gateway.init', () => { expect(gateway.connected).to.equal(false); expect(gateway.usersKeys).to.deep.equal(userKeys); expect(gateway.backupSchedule).to.deep.contains({ - rule: { tz: 'Europe/Paris', hour: 0, minute: 0, second: 0 }, + rule: { tz: 'Europe/Paris', hour: 2, minute: 0, second: 0 }, }); });