Skip to content

Commit e28bca3

Browse files
committed
Clarify error.
1 parent 310bb25 commit e28bca3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Model/Table/QueueProcessesTable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,17 @@ public function validationDefault(Validator $validator): Validator {
112112
* @param string $value
113113
* @param array<string, mixed> $context
114114
*
115-
* @return bool
115+
* @return string|bool
116116
*/
117-
public function validateCount(string $value, array $context): bool {
117+
public function validateCount(string $value, array $context) {
118118
$maxWorkers = Config::maxworkers();
119119
if (!$value || !$maxWorkers) {
120120
return true;
121121
}
122122

123123
$currentWorkers = $this->find()->where(['server' => $value])->count();
124124
if ($currentWorkers >= $maxWorkers) {
125-
return false;
125+
return 'Too many workers running (' . $currentWorkers . '/' . $maxWorkers . '). Check your `Queue.maxworkers` config.';
126126
}
127127

128128
return true;

0 commit comments

Comments
 (0)