Skip to content

[BUGFIX] prevent cache flushing when no files found#10

Open
achimfritz wants to merge 1 commit intomasterfrom
bugfix/cache
Open

[BUGFIX] prevent cache flushing when no files found#10
achimfritz wants to merge 1 commit intomasterfrom
bugfix/cache

Conversation

@achimfritz
Copy link
Copy Markdown

No description provided.

$files = $this->fileRepository->findAllNonCompressedInStorageWithLimit($fileStorage, $limit, $excludeFolders);
$this->compressImages($files);
$this->clearPageCache();
if (count($files) > 0) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only use count() if there is always an array, othwise we'll get a PHP warning from PHP 7.2+. Safer it's to use if (!empty($files)) plus it's also faster than count.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants