mirror of
https://github.com/friendica/friendica
synced 2024-12-22 17:20:16 +00:00
Replace worker_daemon_mode config entry with key-value entry
This commit is contained in:
parent
6b3265742a
commit
b227d65dfc
3 changed files with 8 additions and 7 deletions
|
@ -115,7 +115,7 @@ if (is_readable($pidfile)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($pid) && in_array($mode, ['stop', 'status'])) {
|
if (empty($pid) && in_array($mode, ['stop', 'status'])) {
|
||||||
DI::config()->set('system', 'worker_daemon_mode', false);
|
DI::keyValue()->set('worker_daemon_mode', false);
|
||||||
die("Pidfile wasn't found. Is the daemon running?\n");
|
die("Pidfile wasn't found. Is the daemon running?\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ if ($mode == 'stop') {
|
||||||
|
|
||||||
Logger::notice('Worker daemon process was killed', ['pid' => $pid]);
|
Logger::notice('Worker daemon process was killed', ['pid' => $pid]);
|
||||||
|
|
||||||
DI::config()->set('system', 'worker_daemon_mode', false);
|
DI::keyValue()->set('worker_daemon_mode', false);
|
||||||
die("Worker daemon process $pid was killed.\n");
|
die("Worker daemon process $pid was killed.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ if (!$foreground) {
|
||||||
DBA::connect();
|
DBA::connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::config()->set('system', 'worker_daemon_mode', true);
|
DI::keyValue()->set('worker_daemon_mode', true);
|
||||||
|
|
||||||
// Just to be sure that this script really runs endlessly
|
// Just to be sure that this script really runs endlessly
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Daemon
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$daemon_mode = DI::config()->get('system', 'worker_daemon_mode', false, true);
|
$daemon_mode = DI::keyValue()->get('worker_daemon_mode') ?? false;
|
||||||
if ($daemon_mode) {
|
if ($daemon_mode) {
|
||||||
return $daemon_mode;
|
return $daemon_mode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1149,11 +1149,12 @@ function update_1502()
|
||||||
function update_1505()
|
function update_1505()
|
||||||
{
|
{
|
||||||
$conditions = [
|
$conditions = [
|
||||||
"(`k` LIKE ?) OR (`k` = ?) OR (`cat` = ? AND `k` LIKE ?)",
|
"(`cat` = ?) AND ((`k` LIKE ?) OR (`k` = ?) OR (`k` LIKE ?) OR (`k` = ?))",
|
||||||
|
"system",
|
||||||
"post_update_%",
|
"post_update_%",
|
||||||
"worker_last_cleaned",
|
"worker_last_cleaned",
|
||||||
"system",
|
"last%",
|
||||||
"last%"
|
"worker_daemon_mode",
|
||||||
];
|
];
|
||||||
|
|
||||||
$postUpdateEntries = DBA::selectToArray('config', ['k', 'v'], $conditions);
|
$postUpdateEntries = DBA::selectToArray('config', ['k', 'v'], $conditions);
|
||||||
|
|
Loading…
Reference in a new issue