Fix more usages of backup.intervalSecs

This commit is contained in:
Girish Ramakrishnan
2020-07-29 09:34:23 -07:00
parent 97967e60e8
commit 5db78ae359
6 changed files with 11 additions and 10 deletions

View File

@@ -62,7 +62,7 @@ function setup(done) {
},
function createSettings(callback) {
settings.setBackupConfig({ provider: 'filesystem', backupFolder: '/tmp', format: 'tgz', retentionPolicy: { keepWithinSecs: 2 * 24 * 60 * 60 } }, callback);
settings.setBackupConfig({ provider: 'filesystem', backupFolder: '/tmp', format: 'tgz', retentionPolicy: { keepWithinSecs: 2 * 24 * 60 * 60 }, schedulePattern: '00 00 23 * * *' }, callback);
}
], done);
}

View File

@@ -32,7 +32,7 @@ function setup(done) {
server.start.bind(server),
database._clear,
settings._setApiServerOrigin.bind(null, 'http://localhost:6060'),
settings.setBackupConfig.bind(null, { provider: 'filesystem', backupFolder: '/tmp', format: 'tgz', retentionPolicy: { keepWithinSecs: 10000 } })
settings.setBackupConfig.bind(null, { provider: 'filesystem', backupFolder: '/tmp', format: 'tgz', retentionPolicy: { keepWithinSecs: 10000 }, schedulePattern: '00 00 23 * * *' })
], done);
}

View File

@@ -220,7 +220,7 @@ describe('Settings API', function () {
format: 'tgz',
encryption: null,
retentionPolicy: { keepWithinSecs: 2 * 24 * 60 * 60 }, // 2 days
intervalSecs: 24 * 60 * 60 // ~1 day
schedulePattern: '00 00 23 * * *' // every day at 11pm
};
it('can get backup_config (default)', function (done) {
@@ -259,9 +259,9 @@ describe('Settings API', function () {
});
});
it('cannot set backup_config without intervalSecs', function (done) {
it('cannot set backup_config without schedulePattern', function (done) {
var tmp = JSON.parse(JSON.stringify(defaultConfig));
delete tmp.intervalSecs;
delete tmp.schedulePattern;
superagent.post(SERVER_URL + '/api/v1/settings/backup_config')
.query({ access_token: token })
@@ -272,9 +272,9 @@ describe('Settings API', function () {
});
});
it('cannot set backup_config with invalid intervalSecs', function (done) {
it('cannot set backup_config with invalid schedulePattern', function (done) {
var tmp = JSON.parse(JSON.stringify(defaultConfig));
tmp.intervalSecs = 'not a number';
tmp.schedulePattern = 'not a pattern';
superagent.post(SERVER_URL + '/api/v1/settings/backup_config')
.query({ access_token: token })