]> git.wh0rd.org - tt-rss.git/blobdiff - update.php
daemon2: use passthrough to daemon-loop
[tt-rss.git] / update.php
index abbe6c577bc5d496859674fc2806989de9205160..fcce26d5c864ff950b8b1ad7e3091632b8d3d5c2 100755 (executable)
@@ -30,6 +30,7 @@
                        "quiet",
                        "log:",
                        "indexes",
+                       "pidlock:",
                        "update-schema",
                        "convert-filters",
                        "force-update",
                $lock_filename = $lock_filename . "-task_" . $options["task"];
        }
 
+       if (isset($options["pidlock"])) {
+               $my_pid = $options["pidlock"];
+               $lock_filename = "update_daemon-$my_pid.lock";
+
+       }
+
+       _debug("Lock: $lock_filename");
+
        $lock_handle = make_lockfile($lock_filename);
        $must_exit = false;
 
+       if (isset($options["task"])) {
+               $waits = $options["task"] * 5;
+               _debug("Waiting before update ($waits)");
+               sleep($waits);
+       }
+
        // Try to lock a file in order to avoid concurrent update.
        if (!$lock_handle) {
                die("error: Can't create lockfile ($lock_filename). ".