]> git.wh0rd.org Git - tt-rss.git/commitdiff
warn if daemon process is not running on server
authorAndrew Dolgov <fox@bah.spb.su>
Mon, 13 Feb 2006 13:08:23 +0000 (14:08 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Mon, 13 Feb 2006 13:08:23 +0000 (14:08 +0100)
functions.php
tt-rss.php

index 55e785488c80ef1fbd5617cfba8a15a0d31111cd..f813b6baab8a8afe568e8e524fd505d55c447241 100644 (file)
                } 
        }
 
+       function file_is_locked($filename) {
+               error_reporting(0);
+               $fp = fopen($filename, "r");
+               error_reporting(DEFAULT_ERROR_LEVEL);
+               if ($fp) {
+                       if (flock($fp, LOCK_EX | LOCK_NB)) {
+                               flock($fp, LOCK_UN);
+                               fclose($fp);
+                               return false;
+                       }
+                       fclose($fp);
+                       return true;
+               }
+               return false;
+       }
+
        function make_lockfile($filename) {
                $fp = fopen($filename, "w");
 
index 1245be27440b810775021da9845bdb827da9009a..37eed61abed0b8c27295dcddcda42cf7b594f409 100644 (file)
 
 <body onload="init()">
 
+<? if (ENABLE_UPDATE_DAEMON && !file_is_locked("update_daemon.lock")) { ?>
+       <div class="warning">
+               <b>Warning:</b> 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.
+       </div>
+<? } ?>
+
 <table width="100%" height="100%" cellspacing="0" cellpadding="0" class="main">
 <? if (get_pref($link, 'DISPLAY_HEADER')) { ?>
 <tr>