From 3c950abd548b2584c67151b55ac2ce8d1e978a5a Mon Sep 17 00:00:00 2001 From: zhaominyong Date: Wed, 13 Jul 2022 10:53:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backup-daemon/customizesystemrestoreproxy.cpp | 1 + backup-daemon/systemrestoreproxy.cpp | 1 + backup-daemon/udisksystemrestoreproxy.cpp | 1 + common/utils.cpp | 2 ++ 4 files changed, 5 insertions(+) diff --git a/backup-daemon/customizesystemrestoreproxy.cpp b/backup-daemon/customizesystemrestoreproxy.cpp index 3ab22a1..e595ebf 100755 --- a/backup-daemon/customizesystemrestoreproxy.cpp +++ b/backup-daemon/customizesystemrestoreproxy.cpp @@ -291,6 +291,7 @@ void CustomizeSystemRestoreProxy::restoreSystem() Utils::writeBackupLog(time + "," + m_curUuid + "," + QString::number(m_backupWrapper.m_type) + ",,,," + m_backupPoint.m_backupName); Utils::updateSyncFile(); + Utils::wait(2); QString fileIfSync = Utils::getSysRootPath() + FILE_IF_SYNC; fileIfSync.replace("//", "/"); QFileInfo file(fileIfSync); diff --git a/backup-daemon/systemrestoreproxy.cpp b/backup-daemon/systemrestoreproxy.cpp index 243efbc..77e52bb 100755 --- a/backup-daemon/systemrestoreproxy.cpp +++ b/backup-daemon/systemrestoreproxy.cpp @@ -353,6 +353,7 @@ void SystemRestoreProxy::restoreSystem() Utils::writeBackupLog(time + "," + m_curUuid + "," + QString::number(m_backupWrapper.m_type) + ",,,," + m_backupPoint.m_backupName); Utils::updateSyncFile(); + Utils::wait(2); QString fileIfSync = Utils::getSysRootPath() + FILE_IF_SYNC; fileIfSync.replace("//", "/"); QFileInfo file(fileIfSync); diff --git a/backup-daemon/udisksystemrestoreproxy.cpp b/backup-daemon/udisksystemrestoreproxy.cpp index c5c7717..ef86e64 100755 --- a/backup-daemon/udisksystemrestoreproxy.cpp +++ b/backup-daemon/udisksystemrestoreproxy.cpp @@ -406,6 +406,7 @@ void UDiskSystemRestoreProxy::restoreSystem() Utils::writeBackupLog(time + "," + m_curUuid + "," + QString::number(m_backupWrapper.m_type) + ",,,," + m_backupPoint.m_backupName); Utils::updateSyncFile(); + Utils::wait(2); QString fileIfSync = Utils::getSysRootPath() + FILE_IF_SYNC; fileIfSync.replace("//", "/"); QFileInfo file(fileIfSync); diff --git a/common/utils.cpp b/common/utils.cpp index 16aa53e..82f54ff 100755 --- a/common/utils.cpp +++ b/common/utils.cpp @@ -1279,6 +1279,8 @@ bool Utils::updateSyncFile() QTextStream out(&file); out << "sync" << END_LINE; + out.flush(); + file.flush(); file.close(); return true;