mirror of
https://github.com/friendica/friendica
synced 2025-04-25 03:50:12 +00:00
Mute warnings in pidfile/Quit poller after an hour.
This commit is contained in:
parent
f8e4a71eda
commit
173d1390df
2 changed files with 10 additions and 4 deletions
|
@ -66,6 +66,8 @@ function poller_run(&$argv, &$argc){
|
|||
if ($workers[0]["workers"] >= $queues)
|
||||
return;
|
||||
|
||||
$starttime = time();
|
||||
|
||||
while ($r = q("SELECT * FROM `workerqueue` WHERE `executed` = '0000-00-00 00:00:00' ORDER BY `created` LIMIT 1")) {
|
||||
|
||||
if(function_exists('sys_getloadavg')) {
|
||||
|
@ -76,6 +78,10 @@ function poller_run(&$argv, &$argc){
|
|||
}
|
||||
}
|
||||
|
||||
// Quit the poller once every hour
|
||||
if (time() > ($starttime + 3600))
|
||||
return;
|
||||
|
||||
q("UPDATE `workerqueue` SET `executed` = '%s', `pid` = %d WHERE `id` = %d",
|
||||
dbesc(datetime_convert()),
|
||||
intval(getmypid()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue