[gnote] Use UTC time in file system sync server
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Use UTC time in file system sync server
- Date: Sat, 14 Mar 2020 14:24:14 +0000 (UTC)
commit 766f2fe4ffcbcc1b7d2bc75e175429d698003762
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sat Mar 14 16:22:43 2020 +0200
Use UTC time in file system sync server
src/synchronization/filesystemsyncserver.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/synchronization/filesystemsyncserver.cpp b/src/synchronization/filesystemsyncserver.cpp
index dbab30e3..59c90456 100644
--- a/src/synchronization/filesystemsyncserver.cpp
+++ b/src/synchronization/filesystemsyncserver.cpp
@@ -198,14 +198,14 @@ bool FileSystemSyncServer::begin_sync_transaction()
DBG_OUT("Sync: Discovered a sync lock file, wait at least %s before trying again.",
sharp::time_span_string(currentSyncLock.duration).c_str());
// This is our initial attempt to sync and we've detected
// a sync file, so we're gonna have to wait.
- m_initial_sync_attempt = Glib::DateTime::create_now_local();
+ m_initial_sync_attempt = Glib::DateTime::create_now_utc();
m_last_sync_lock_hash = currentSyncLock.hash_string();
return false;
}
else if(m_last_sync_lock_hash != currentSyncLock.hash_string()) {
DBG_OUT("Sync: Updated sync lock file discovered, wait at least %s before trying again.",
sharp::time_span_string(currentSyncLock.duration).c_str());
// The sync lock has been updated and is still a valid lock
- m_initial_sync_attempt = Glib::DateTime::create_now_local();
+ m_initial_sync_attempt = Glib::DateTime::create_now_utc();
m_last_sync_lock_hash = currentSyncLock.hash_string();
return false;
}
@@ -214,7 +214,7 @@ bool FileSystemSyncServer::begin_sync_transaction()
// The sync lock has is the same so check to see if the
// duration of the lock has expired. If it hasn't, wait
// even longer.
- if(Glib::DateTime::create_now_local().add(-currentSyncLock.duration) < m_initial_sync_attempt) {
+ if(Glib::DateTime::create_now_utc().add(-currentSyncLock.duration) < m_initial_sync_attempt) {
DBG_OUT("Sync: You haven't waited long enough for the sync file to expire.");
return false;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]