[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon May 9 05:26:56 UTC 2016


 loolwsd/DocumentBroker.cpp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8f5f0ffdb1642f56a42e0075beb7429e754c7be0
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Mon May 9 01:02:42 2016 -0400

    loolwsd: don't persist documents again within 10 seconds
    
    Change-Id: Ic11ef0bb4cdb85481a504729f2dfe26f5c80ee9c
    Reviewed-on: https://gerrit.libreoffice.org/24784
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index adde590..f0e6173 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


More information about the Libreoffice-commits mailing list