Browse Source

Fix: Corected config value name

Michael 2 months ago
parent
commit
5fc6c0ef38
2 changed files with 8 additions and 2 deletions
  1. 2
    2
      config/defaults.config.php
  2. 6
    0
      src/Core/Worker.php

+ 2
- 2
config/defaults.config.php View File

@@ -397,9 +397,9 @@ return [
397 397
 		// If enabled, it prints out the jobs per minute.
398 398
 		'worker_jpm' => false,
399 399
 
400
-		// worker_jpm_limit (String)
400
+		// worker_jpm_range (String)
401 401
 		// List of minutes for the jobs per minute (JPM) calculation
402
-		'worker_jpm_limit' => '1, 10, 60',
402
+		'worker_jpm_range' => '1, 10, 60',
403 403
 
404 404
 		// worker_load_exponent (Integer)
405 405
 		// Default 3, which allows only 25% of the maximum worker queues when server load reaches around 37% of maximum load.

+ 6
- 0
src/Core/Worker.php View File

@@ -718,6 +718,12 @@ class Worker
718 718
 				$intervals = explode(',', Config::get('system', 'worker_jpm_range'));
719 719
 				$jobs_per_minute = [];
720 720
 				foreach ($intervals as $interval) {
721
+					if ($interval == 0) {
722
+						continue;
723
+					} else {
724
+						$interval = (int)$interval;
725
+					}
726
+
721 727
 					$stamp = (float)microtime(true);
722 728
 					$jobs = DBA::p("SELECT COUNT(*) AS `jobs` FROM `workerqueue` WHERE `done` AND `executed` > UTC_TIMESTAMP() - INTERVAL ? MINUTE", $interval);
723 729
 					self::$db_duration += (microtime(true) - $stamp);

Loading…
Cancel
Save