From e759497af32681e0932475114bcda8b8adf67df8 Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Sun, 4 Nov 2018 10:51:01 +0000
Subject: [PATCH] Fix small typo / Workerqueue count now only counts non
 deferred entries

---
 src/Core/Worker.php                   | 5 +++--
 src/Protocol/ActivityPub/Receiver.php | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/Core/Worker.php b/src/Core/Worker.php
index c053e32bc8..f3736d2573 100644
--- a/src/Core/Worker.php
+++ b/src/Core/Worker.php
@@ -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"];
 					}
diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php
index 379fb7a7fc..2cc165b233 100644
--- a/src/Protocol/ActivityPub/Receiver.php
+++ b/src/Protocol/ActivityPub/Receiver.php
@@ -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;
-- 
2.39.5