mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 16:18:05 +02:00
Make backup directory in content manager const
This commit is contained in:
parent
dd398da2e0
commit
80b03b9046
2 changed files with 1 additions and 14 deletions
|
@ -370,25 +370,12 @@ void DomainContentBackupManager::backup() {
|
||||||
qCDebug(domain_server) << "Time since last backup [" << secondsSinceLastBackup << "] for rule [" << rule.name
|
qCDebug(domain_server) << "Time since last backup [" << secondsSinceLastBackup << "] for rule [" << rule.name
|
||||||
<< "] exceeds backup interval [" << rule.intervalSeconds << "] doing backup now...";
|
<< "] exceeds backup interval [" << rule.intervalSeconds << "] doing backup now...";
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
auto timestamp = QDateTime::currentDateTime().toString(DATETIME_FORMAT);
|
|
||||||
auto fileName = "backup-" + rule.extensionFormat + timestamp + ".zip";
|
|
||||||
QuaZip zip(_backupDirectory + "/" + fileName);
|
|
||||||
if (!zip.open(QuaZip::mdAdd)) {
|
|
||||||
qDebug() << "Could not open backup archive:" << zip.getZipName();
|
|
||||||
qDebug() << " ERROR:" << zip.getZipError();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto& handler : _backupHandlers) {
|
|
||||||
handler.createBackup(zip);
|
|
||||||
=======
|
|
||||||
bool success;
|
bool success;
|
||||||
QString path;
|
QString path;
|
||||||
std::tie(success, path) = createBackup(AUTOMATIC_BACKUP_PREFIX, rule.extensionFormat);
|
std::tie(success, path) = createBackup(AUTOMATIC_BACKUP_PREFIX, rule.extensionFormat);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
qCWarning(domain_server) << "Failed to create backup for" << rule.name << "at" << path;
|
qCWarning(domain_server) << "Failed to create backup for" << rule.name << "at" << path;
|
||||||
continue;
|
continue;
|
||||||
>>>>>>> dd86471a42... Add backup DS APIs
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << "Created backup: " << path;
|
qDebug() << "Created backup: " << path;
|
||||||
|
|
|
@ -83,7 +83,7 @@ protected:
|
||||||
std::pair<bool, QString> createBackup(const QString& prefix, const QString& name);
|
std::pair<bool, QString> createBackup(const QString& prefix, const QString& name);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString _backupDirectory;
|
const QString _backupDirectory;
|
||||||
std::vector<BackupHandler> _backupHandlers;
|
std::vector<BackupHandler> _backupHandlers;
|
||||||
int _persistInterval { 0 };
|
int _persistInterval { 0 };
|
||||||
bool _initialLoadComplete { false };
|
bool _initialLoadComplete { false };
|
||||||
|
|
Loading…
Reference in a new issue