rename backupTargets to backupSites
This commit is contained in:
+6
-6
@@ -20,7 +20,7 @@ exports = module.exports = {
|
||||
const apps = require('./apps.js'),
|
||||
assert = require('node:assert'),
|
||||
{ AsyncTask } = require('./asynctask.js'),
|
||||
backupTargets = require('./backuptargets.js'),
|
||||
backupSites = require('./backupsites.js'),
|
||||
BoxError = require('./boxerror.js'),
|
||||
debug = require('debug')('box:system'),
|
||||
df = require('./df.js'),
|
||||
@@ -125,15 +125,15 @@ async function getFilesystems() {
|
||||
filesystems[diskInfo.filesystem].contents.push(stdPath);
|
||||
}
|
||||
|
||||
for (const backupTarget of await backupTargets.list(1, 100)) {
|
||||
if (backupTarget.provider === 'filesystem') {
|
||||
const [, dfResult] = await safe(df.file(backupTarget.config.backupDir));
|
||||
for (const backupSite of await backupSites.list(1, 100)) {
|
||||
if (backupSite.provider === 'filesystem') {
|
||||
const [, dfResult] = await safe(df.file(backupSite.config.backupDir));
|
||||
const filesystem = dfResult?.filesystem || rootDisk.filesystem;
|
||||
if (filesystems[filesystem]) filesystems[filesystem].contents.push({ type: 'cloudron-backup', id: backupTarget.id, path: backupTarget.config.backupDir });
|
||||
if (filesystems[filesystem]) filesystems[filesystem].contents.push({ type: 'cloudron-backup', id: backupSite.id, path: backupSite.config.backupDir });
|
||||
}
|
||||
|
||||
// often the default backup dir is not cleaned up
|
||||
if (backupTarget.provider !== 'filesystem' || backupTarget.config.backupDir !== paths.DEFAULT_BACKUP_DIR) {
|
||||
if (backupSite.provider !== 'filesystem' || backupSite.config.backupDir !== paths.DEFAULT_BACKUP_DIR) {
|
||||
const [, dfResult] = await safe(df.file(paths.DEFAULT_BACKUP_DIR));
|
||||
const filesystem = dfResult?.filesystem || rootDisk.filesystem;
|
||||
if (filesystems[filesystem]) filesystems[filesystem].contents.push({ type: 'cloudron-backup-default', id: 'cloudron-backup-default', path: paths.DEFAULT_BACKUP_DIR });
|
||||
|
||||
Reference in New Issue
Block a user