]> git.wh0rd.org - tt-rss.git/commitdiff
daemon: enable master lockfile
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 25 Feb 2013 17:28:34 +0000 (21:28 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 25 Feb 2013 17:28:34 +0000 (21:28 +0400)
update_daemon2.php

index f2a962629d7d1b7f92c92bb31ea7183635237421..cee61bb6e69ad52e3a5c6d93db0d025b2d5d2a34 100755 (executable)
                        "Maybe another daemon is already running.\n");
        }
 
+       // Try to lock a file in order to avoid concurrent update.
+       $lock_handle = make_lockfile("update_daemon.lock");
+
+       if (!$lock_handle) {
+               die("error: Can't create lockfile. ".
+                       "Maybe another daemon is already running.\n");
+       }
+
        /* if (!pcntl_fork()) {
                pcntl_signal(SIGINT, 'sigint_handler');
                register_shutdown_function('shutdown');