Improving how last_sync is updated 2, a=chris
Improving how last_sync is updated 2, a=chris
diff --git a/bin/mirror.php b/bin/mirror.php
index ba95a3b66..6fd7e9c67 100644
--- a/bin/mirror.php
+++ b/bin/mirror.php
@@ -233,18 +233,20 @@ class Mirror implements CrawlConstants
} else if(isset($info[self::STATUS]) &&
$info[self::STATUS] == self::NO_DATA_STATE) {
$this->last_sync = $time;
+ $this->start_sync = $time;
}
} else {
- $info[self::STATUS] = self::CONTINUE_STATE;
+ $info[self::STATUS] = ($this->last_sync == $this->start_sync) ?
+ self::NO_DATA_STATE : self::CONTINUE_STATE;
+ crawlLog("Current time $time, last notify time ".
+ $this->last_notify."...");
if($time - $this->last_notify > MIRROR_NOTIFY_FREQUENCY) {
$request .= "&a=syncNotify";
- crawlLog("Current time $time, last notify time ".
- $this->last_notify."...");
FetchUrl::getPage($request, NULL, true);
$this->last_notify = $time;
crawlLog("Notifying master that mirror is alive..");
} else {
- crawlLog("So not notifying scheduler");
+ crawlLog("So not notifying scheduler..");
}
}
if(count($this->sync_schedule) == 0) {