]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix hanged daemon notification
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 28 Sep 2007 03:06:44 +0000 (04:06 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 28 Sep 2007 03:06:44 +0000 (04:06 +0100)
functions.php
modules/popup-dialog.php

index 430525754f59718b6bf459eafb461eac3e79cf86..592272000dbd065c1694d9fe69fb41754c829b12 100644 (file)
                        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();
                        }
                }
 
index 34f6311c9faa665215e9bbe2c6c3f1a9fbb34ea5..55ff54f9d82aedddd7154468a21a139075c4e2ae 100644 (file)
                                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) {
                                        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>";