summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-09-28 04:06:44 +0100
committerAndrew Dolgov <[email protected]>2007-09-28 04:06:44 +0100
commitf6854e447ba9d45638c0f3a905b6d131a26414fd (patch)
tree470366e813d4c176378b1379716c7d475f68a7fe
parente2438754ff8300f7fc275611f768efaaa86a6a63 (diff)
fix hanged daemon notification
-rw-r--r--functions.php13
-rw-r--r--modules/popup-dialog.php10
2 files changed, 17 insertions, 6 deletions
diff --git a/functions.php b/functions.php
index 430525754..592272000 100644
--- a/functions.php
+++ b/functions.php
@@ -2702,23 +2702,24 @@
print "<param key=\"daemon_is_running\" value=\"".
sprintf("%d", file_is_locked("update_daemon.lock")) . "\"/>";
- if ($_SESSION["daemon_stamp_check"] + 600 < time()) {
+ if (time() - $_SESSION["daemon_stamp_check"] > 600) {
$stamp = (int)read_stampfile("update_daemon.stamp");
if ($stamp) {
- if ($stamp + 86400*3 < time()) {
- print "<param key=\"daemon_stamp_ok\" value=\"0\"/>";
+ if (time() - $stamp > 86400) {
+ $stamp_check = 0;
} else {
- print "<param key=\"daemon_stamp_ok\" value=\"1\"/>";
+ $stamp_check = 1;
+ $_SESSION["daemon_stamp_check"] = time();
}
+ print "<param key=\"daemon_stamp_ok\" value=\"$stamp_check\"/>";
+
$stamp_fmt = date("Y.m.d, G:i", $stamp);
print "<param key=\"daemon_stamp\" value=\"$stamp_fmt\"/>";
}
-
- $_SESSION["daemon_stamp_check"] = time();
}
}
diff --git a/modules/popup-dialog.php b/modules/popup-dialog.php
index 34f6311c9..55ff54f9d 100644
--- a/modules/popup-dialog.php
+++ b/modules/popup-dialog.php
@@ -12,6 +12,11 @@
print __("Update daemon is enabled in configuration, but daemon
process is not running, which prevents all feeds from updating. Please
start the daemon process or contact instance owner.");
+
+ $stamp = (int)read_stampfile("update_daemon.stamp");
+
+ print "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp);
+
}
if ($param == 2) {
@@ -31,6 +36,11 @@
perform a feed update. This could indicate a problem like crash
or a hang. Please check the daemon process or contact instance
owner.");
+
+ $stamp = (int)read_stampfile("update_daemon.stamp");
+
+ print "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp);
+
}
print "</div>";