summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-02-13 14:08:23 +0100
committerAndrew Dolgov <[email protected]>2006-02-13 14:08:23 +0100
commit27981ca30f85655ca487257418b19a17f962b0c3 (patch)
tree7257ef8804107f522a95649273ce4e56d554ff4c
parent3e4950c7bb00a0ed819a81f20ca3cb3a004fdccc (diff)
warn if daemon process is not running on server
-rw-r--r--functions.php16
-rw-r--r--tt-rss.php8
2 files changed, 24 insertions, 0 deletions
diff --git a/functions.php b/functions.php
index 55e785488..f813b6baa 100644
--- a/functions.php
+++ b/functions.php
@@ -928,6 +928,22 @@
}
}
+ 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");
diff --git a/tt-rss.php b/tt-rss.php
index 1245be274..37eed61ab 100644
--- a/tt-rss.php
+++ b/tt-rss.php
@@ -50,6 +50,14 @@
<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>