Merge pull request #6072 from annando/fix-6071

Fixes #6071: We should use the correct variable ...
This commit is contained in:
Hypolite Petovan 2018-11-04 15:45:38 -05:00 committed by GitHub
commit 95a41699cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View file

@ -668,9 +668,10 @@ class Worker
DBA::close($processes);
// Now adding all processes with workerqueue entries
$entries = DBA::p("SELECT COUNT(*) AS `entries`, `priority` FROM `workerqueue` WHERE NOT `done` GROUP BY `priority`");
$entries = DBA::p("SELECT COUNT(*) AS `entries`, `priority` FROM `workerqueue` WHERE NOT `done` AND `next_try` < ? GROUP BY `priority`", DateTimeFormat::utcNow());
while ($entry = DBA::fetch($entries)) {
$processes = DBA::p("SELECT COUNT(*) AS `running` FROM `process` INNER JOIN `workerqueue` ON `workerqueue`.`pid` = `process`.`pid` AND NOT `done` WHERE `priority` = ?", $entry["priority"]);
$processes = DBA::p("SELECT COUNT(*) AS `running` FROM `process` INNER JOIN `workerqueue` ON `workerqueue`.`pid` = `process`.`pid` WHERE NOT `done` AND `next_try` < ? AND `priority` = ?",
DateTimeFormat::utcNow(), $entry["priority"]);
if ($process = DBA::fetch($processes)) {
$listitem[$entry["priority"]] = $entry["priority"].":".$process["running"]."/".$entry["entries"];
}

View file

@ -67,7 +67,7 @@ class ActivityPub
public static function fetchContent($url, $uid = 0)
{
if (!empty($uid)) {
return HTTPSignature::fetch($url, 1);
return HTTPSignature::fetch($url, $uid);
}
$curlResult = Network::curl($url, false, $redirects, ['accept_content' => 'application/activity+json, application/ld+json']);

View file

@ -240,7 +240,7 @@ class Receiver
}
/**
* Fetches the first uider id from the receiver array
* Fetches the first user id from the receiver array
*
* @param array $receivers Array with receivers
* @return integer user id;