From 8f5f0ffdb1642f56a42e0075beb7429e754c7be0 Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Mon, 9 May 2016 01:02:42 -0400 Subject: [PATCH] loolwsd: don't persist documents again within 10 seconds Change-Id: Ic11ef0bb4cdb85481a504729f2dfe26f5c80ee9c Reviewed-on: https://gerrit.libreoffice.org/24784 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian --- loolwsd/DocumentBroker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp index adde590f4..f0e6173d2 100644 --- a/loolwsd/DocumentBroker.cpp +++ b/loolwsd/DocumentBroker.cpp @@ -177,7 +177,7 @@ bool DocumentBroker::save() const auto uri = _uriPublic.toString(); - // If we aren't potentially destroying just yet, and the file hasn't been + // If we aren't potentially destroying just yet, and the file has been // modified within the past 10 seconds, skip saving. // // FIXME this is because currently the ChildProcessSession broadcasts the @@ -189,7 +189,7 @@ bool DocumentBroker::save() // is planned post-release. const auto newFileModifiedTime = Poco::File(_storage->getLocalRootPath()).getLastModified(); const auto elapsed = newFileModifiedTime - _lastFileModifiedTime; - if (!canDestroy() && std::abs(elapsed) > 10 * 1000 * 1000) + if (!canDestroy() && std::abs(elapsed) < 10 * 1000) { // Nothing to do. Log::debug() << "Skipping unnecessary saving to URI [" << uri