Commit 67c3b0c1 authored by skummer's avatar skummer

ZP-369 #comment check if the uuid is already known by the loop detection...

ZP-369 #comment check if the uuid is already known by the loop detection (issue after resyncs) #time 45m

git-svn-id: https://z-push.org/svn/z-push/trunk@1661 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent 832763ed
...@@ -515,6 +515,7 @@ class LoopDetection extends InterProcessData { ...@@ -515,6 +515,7 @@ class LoopDetection extends InterProcessData {
$this->checkArrayStructure($loopdata, $folderid); $this->checkArrayStructure($loopdata, $folderid);
$current = $loopdata[self::$devid][self::$user][$folderid]; $current = $loopdata[self::$devid][self::$user][$folderid];
// update the usage flag // update the usage flag
$current["usage"] = $counter; $current["usage"] = $counter;
...@@ -557,16 +558,18 @@ class LoopDetection extends InterProcessData { ...@@ -557,16 +558,18 @@ class LoopDetection extends InterProcessData {
$current = $loopdata[self::$devid][self::$user][$folderid]; $current = $loopdata[self::$devid][self::$user][$folderid];
if (!empty($current)) { if (!empty($current)) {
if ($current["uuid"] != $uuid) { if (!isset($current["uuid"]) || $current["uuid"] != $uuid) {
ZLog::Write(LOGLEVEL_DEBUG, "LoopDetection->IsSyncStateObsolete(): yes, uuid changed"); ZLog::Write(LOGLEVEL_DEBUG, "LoopDetection->IsSyncStateObsolete(): yes, uuid changed or not set");
$obsolete = true; $obsolete = true;
} }
ZLog::Write(LOGLEVEL_DEBUG, sprintf("LoopDetection->IsSyncStateObsolete(): check uuid counter: %d - last known counter: %d with %d queued objects", $counter, $current["count"], $current["queued"])); else {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("LoopDetection->IsSyncStateObsolete(): check uuid counter: %d - last known counter: %d with %d queued objects", $counter, $current["count"], $current["queued"]));
if ($current["uuid"] == $uuid && ($current["count"] > $counter || ($current["count"] == $counter && $current["queued"] > 0) || (isset($current["usage"]) && $current["usage"] >= $counter))) { if ($current["uuid"] == $uuid && ($current["count"] > $counter || ($current["count"] == $counter && $current["queued"] > 0) || (isset($current["usage"]) && $current["usage"] >= $counter))) {
$usage = isset($current["usage"]) ? sprintf(" - counter %d already expired",$current["usage"]) : ""; $usage = isset($current["usage"]) ? sprintf(" - counter %d already expired",$current["usage"]) : "";
ZLog::Write(LOGLEVEL_DEBUG, "LoopDetection->IsSyncStateObsolete(): yes, counter already processed". $usage); ZLog::Write(LOGLEVEL_DEBUG, "LoopDetection->IsSyncStateObsolete(): yes, counter already processed". $usage);
$obsolete = true; $obsolete = true;
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment