From c230e503e6eec2479c2a441573ef2075b0d776ac Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Fri, 26 Oct 2018 14:20:14 +0200 Subject: [PATCH] Fix global checksum calculation --- lib/remote/apilistener-filesync.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/remote/apilistener-filesync.cpp b/lib/remote/apilistener-filesync.cpp index d0c2fcf1b..95c7df0dd 100644 --- a/lib/remote/apilistener-filesync.cpp +++ b/lib/remote/apilistener-filesync.cpp @@ -599,7 +599,22 @@ String ApiListener::GetGlobalChecksum(const ConfigDirInformation& config) ObjectLock olock(checksums); for (const Dictionary::Pair& kv : checksums) { - result += GetChecksum(kv.second); + String path = kv.first; + String checksum = kv.second; + + /* Only use configuration files for checksum calculation. */ + //if (!Utility::Match("*.conf", path)) + // continue; + + /* Ignore internal files, especially .timestamp and .checksums. + * If we don't, this results in "always change" restart loops. + */ + if (Utility::Match("/.*", path)) + continue; + + Log(LogCritical, "ApiListener") + << "Adding checksum for " << kv.first << ": " << kv.second; + result += kv.second; } return GetChecksum(result); -- 2.40.0