diff --git a/src/config.php b/src/config.php index 54039f1a..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). Set to `null` to inherit the default 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). Set to `null` to inherit the default 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/jobs/GenerateCacheJob.php b/src/jobs/GenerateCacheJob.php index a84236b7..0624d7cd 100644 --- a/src/jobs/GenerateCacheJob.php +++ b/src/jobs/GenerateCacheJob.php @@ -61,7 +61,7 @@ public function canRetry($attempt, $error): bool public function execute($queue): void { // Decrement (increase) priority so that subsequent batches are prioritised. - if ($this->itemOffset === 0) { + if ($this->itemOffset === 0 && $this->priority > 0) { $this->priority--; } diff --git a/src/models/SettingsModel.php b/src/models/SettingsModel.php index bf55ca71..d134d710 100644 --- a/src/models/SettingsModel.php +++ b/src/models/SettingsModel.php @@ -428,9 +428,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. @@ -438,9 +438,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.