mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-08 06:32:35 +02:00
Fix incorrect "all backups loaded" flag
This commit is contained in:
parent
e967ed0e22
commit
e12ca2683f
2 changed files with 4 additions and 6 deletions
|
@ -101,7 +101,10 @@ void AssetsBackupHandler::checkForAssetsToDelete() {
|
|||
|
||||
if (deprecatedAssets.size() > 0) {
|
||||
qCDebug(asset_backup) << "Found" << deprecatedAssets.size() << "backup assets to delete from disk.";
|
||||
if (_allBackupsLoadedSuccessfully) {
|
||||
const auto noCorruptedBackups = none_of(begin(_backups), end(_backups), [&](const AssetServerBackup& backup) {
|
||||
return backup.corruptedBackup;
|
||||
});
|
||||
if (noCorruptedBackups) {
|
||||
for (const auto& hash : deprecatedAssets) {
|
||||
QFile::remove(_assetsDirectory + hash);
|
||||
}
|
||||
|
@ -175,7 +178,6 @@ void AssetsBackupHandler::loadBackup(const QString& backupName, QuaZip& zip) {
|
|||
qCCritical(asset_backup) << "Failed to find" << MAPPINGS_FILE << "while loading backup";
|
||||
qCCritical(asset_backup) << " Error:" << zip.getZipError();
|
||||
backup.corruptedBackup = true;
|
||||
_allBackupsLoadedSuccessfully = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -184,7 +186,6 @@ void AssetsBackupHandler::loadBackup(const QString& backupName, QuaZip& zip) {
|
|||
qCCritical(asset_backup) << "Could not unzip backup file for load:" << backupName;
|
||||
qCCritical(asset_backup) << " Error:" << zip.getZipError();
|
||||
backup.corruptedBackup = true;
|
||||
_allBackupsLoadedSuccessfully = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -194,7 +195,6 @@ void AssetsBackupHandler::loadBackup(const QString& backupName, QuaZip& zip) {
|
|||
qCCritical(asset_backup) << "Could not parse backup file to JSON object for load:" << backupName;
|
||||
qCCritical(asset_backup) << " Error:" << error.errorString();
|
||||
backup.corruptedBackup = true;
|
||||
_allBackupsLoadedSuccessfully = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,6 @@ void AssetsBackupHandler::loadBackup(const QString& backupName, QuaZip& zip) {
|
|||
if (!AssetUtils::isValidHash(assetHash)) {
|
||||
qCCritical(asset_backup) << "Corrupted mapping in loading backup file" << backupName << ":" << it.key();
|
||||
backup.corruptedBackup = true;
|
||||
_allBackupsLoadedSuccessfully = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,6 @@ private:
|
|||
};
|
||||
|
||||
// Internal storage for backups on disk
|
||||
bool _allBackupsLoadedSuccessfully { false };
|
||||
std::vector<AssetServerBackup> _backups;
|
||||
std::set<AssetUtils::AssetHash> _assetsInBackups;
|
||||
std::set<AssetUtils::AssetHash> _assetsOnDisk;
|
||||
|
|
Loading…
Reference in a new issue