Skip to content

Commit

Permalink
Fix unnecessary error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Dec 7, 2023
1 parent 9bdb170 commit 763e66f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes for Cloudflare

## 2.0.2 - 2023-12-07

### Fixed

- Fixed a bug in which an error was being logged unnecessarily when no valid URLs were present ([#66](https://github.com/putyourlightson/craft-cloudflare/issues/66)).

## 2.0.1 - 2023-08-20

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "putyourlightson/craft-cloudflare",
"description": "Purge Cloudflare caches from Craft.",
"version": "2.0.1",
"version": "2.0.2",
"type": "craft-plugin",
"license": "mit",
"require": {
Expand Down
4 changes: 4 additions & 0 deletions src/services/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ public function purgeCachesForUrl(string $url, bool $immediately = false): void
);
}

if (empty($urlsToPurge)) {
return;
}

if ($immediately) {
Cloudflare::$plugin->api->purgeUrls($urlsToPurge);
} else {
Expand Down

0 comments on commit 763e66f

Please sign in to comment.