From 493c12846af740364891574ff80a90c81510e072 Mon Sep 17 00:00:00 2001 From: Daniel Mason Date: Fri, 10 Jan 2020 11:35:56 +1300 Subject: [PATCH] Switched IF Statement order to prevent excess calls to redis. --- CHANGELOG.md | 3 +++ composer.json | 2 +- lib/Resque.php | 2 +- lib/Resque/Worker.php | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 143bbc6..3d58049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 1.4.6 (2020-01-10) +- Switched IF Statement order to prevent excess calls to redis. + ## 1.4.5 (2019-08-28) - Added 'replaced' composer tag. - Formatting changes. diff --git a/composer.json b/composer.json index f4518c2..d4327b8 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "idanoo/php-resque", - "version": "1.4.5", + "version": "1.4.6", "type": "library", "replace": { "chrisboulton/php-resque": "*", diff --git a/lib/Resque.php b/lib/Resque.php index 07c7806..68b0067 100644 --- a/lib/Resque.php +++ b/lib/Resque.php @@ -10,7 +10,7 @@ class Resque { - const VERSION = '1.4.5'; + const VERSION = '1.4.6'; const DEFAULT_INTERVAL = 5; diff --git a/lib/Resque/Worker.php b/lib/Resque/Worker.php index add97ec..e81015c 100644 --- a/lib/Resque/Worker.php +++ b/lib/Resque/Worker.php @@ -117,7 +117,7 @@ class Resque_Worker */ public static function find($workerId) { - if (!self::exists($workerId) || false === strpos($workerId, ":")) { + if (false === strpos($workerId, ":") || !self::exists($workerId)) { return false; } /** @noinspection PhpUnusedLocalVariableInspection */