From b95943d3e8a368d5a5ff99746420a3ed375f479b Mon Sep 17 00:00:00 2001 From: bencroker Date: Thu, 27 Jun 2024 17:12:00 +0200 Subject: [PATCH] Allow `null` value in priority --- CHANGELOG.md | 5 +++-- src/config.php | 4 ++-- src/models/SettingsModel.php | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f5a163a..a29f2e39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,11 @@ # Release Notes for Blitz -## 4.18.3 - Unreleased +## 4.18.3 - 2024-06-27 ### Fixed -- Fixed an issue in which the priority of batch jobs could end up being a negative number. +- Fixed a bug in which the priority of refresh cache and driver jobs was interpreted as `0` when set to `null`. +- Fixed an issue in which the priority of batch jobs could be a negative number and therefore jobs would never complete. ## 4.18.2 - 2024-06-18 diff --git a/src/config.php b/src/config.php index 5e718f17..7927a912 100644 --- a/src/config.php +++ b/src/config.php @@ -248,13 +248,13 @@ // - `3`: Append "served by" comment only //'outputComments' => true, - // The priority to give the refresh cache job (the lower the number, the higher the priority). + // The priority to give the refresh cache job (the lower the number, the higher the priority). If set to `null`, the default job priority will be used. //'refreshCacheJobPriority' => 10, //The batch size to use for driver jobs that support batching. //'driverJobBatchSize' => 100, - // The priority to give driver jobs (the lower the number, the higher the priority). + // The priority to give driver jobs (the lower the number, the higher the priority). If set to `null`, the default job priority will be used. //'driverJobPriority' => 100, // The time to reserve for queue jobs in seconds. diff --git a/src/models/SettingsModel.php b/src/models/SettingsModel.php index e1d8182c..27fb5d00 100644 --- a/src/models/SettingsModel.php +++ b/src/models/SettingsModel.php @@ -442,9 +442,9 @@ class SettingsModel extends Model public int|bool $outputComments = true; /** - * The priority to give the refresh cache job (the lower the number, the higher the priority). + * The priority to give the refresh cache job (the lower the number, the higher the priority). If set to `null`, the default job priority will be used. */ - public int $refreshCacheJobPriority = 10; + public ?int $refreshCacheJobPriority = 10; /** * The batch size to use for driver jobs that support batching. @@ -452,9 +452,9 @@ class SettingsModel extends Model public int $driverJobBatchSize = 100; /** - * The priority to give driver jobs (the lower the number, the higher the priority). + * The priority to give driver jobs (the lower the number, the higher the priority). If set to `null`, the default job priority will be used. */ - public int $driverJobPriority = 100; + public ?int $driverJobPriority = 100; /** * The time to reserve for queue jobs in seconds.