1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-26 08:31:28 +00:00

daemon2: use passthrough to daemon-loop

This commit is contained in:
Andrew Dolgov
2013-04-17 18:19:26 +04:00
parent eefaa2df38
commit 7440a7fe3c
3 changed files with 19 additions and 59 deletions

View File

@@ -30,6 +30,7 @@
"quiet",
"log:",
"indexes",
"pidlock:",
"update-schema",
"convert-filters",
"force-update",
@@ -113,9 +114,23 @@
$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). ".