only write to backups bucket in self host

This commit is contained in:
Martin McKeaveney 2021-09-21 14:36:30 +01:00
parent 9cc55c08d3
commit f9d368f021
1 changed files with 7 additions and 5 deletions

View File

@ -130,11 +130,13 @@ exports.performBackup = async (appId, backupName) => {
), ),
}) })
// write the file to the object store // write the file to the object store
if (env.SELF_HOSTED) {
await streamUpload( await streamUpload(
ObjectStoreBuckets.BACKUPS, ObjectStoreBuckets.BACKUPS,
join(appId, backupName), join(appId, backupName),
fs.createReadStream(path) fs.createReadStream(path)
) )
}
return fs.createReadStream(path) return fs.createReadStream(path)
} }