mirror of
https://github.com/friendica/friendica
synced 2025-04-27 11:50:11 +00:00
Don't always fork the poller.
This commit is contained in:
parent
fb72fc77f5
commit
8db079c65e
4 changed files with 9 additions and 17 deletions
13
boot.php
13
boot.php
|
@ -35,6 +35,7 @@ require_once 'include/features.php';
|
|||
require_once 'include/identity.php';
|
||||
require_once 'update.php';
|
||||
require_once 'include/dbstructure.php';
|
||||
require_once 'include/poller.php';
|
||||
|
||||
define ( 'FRIENDICA_PLATFORM', 'Friendica');
|
||||
define ( 'FRIENDICA_CODENAME', 'Asparagus');
|
||||
|
@ -1095,18 +1096,8 @@ function proc_run($cmd) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Checking number of workers
|
||||
$workers = q("SELECT COUNT(*) AS `workers` FROM `workerqueue` WHERE `executed` > '%s'", dbesc(NULL_DATE));
|
||||
|
||||
// Get number of allowed number of worker threads
|
||||
$queues = intval(get_config("system", "worker_queues"));
|
||||
|
||||
if ($queues == 0) {
|
||||
$queues = 4;
|
||||
}
|
||||
|
||||
// If there are already enough workers running, don't fork another one
|
||||
if ($workers[0]["workers"] >= $queues) {
|
||||
if (poller_too_much_workers()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue