Skip to content

Commit

Permalink
bug #33842 [Cache] fix logger usage in CacheTrait::doGet() (nicolas-g…
Browse files Browse the repository at this point in the history
…rekas)

This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] fix logger usage in CacheTrait::doGet()

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #33838
| License       | MIT
| Doc PR        | -

Commits
-------

ca6515c [Cache] fix logger usage in CacheTrait::doGet()
  • Loading branch information
nicolas-grekas committed Oct 4, 2019
2 parents 2c2d2ac + ca6515c commit 3786d4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Contracts/Cache/CacheTrait.php
Expand Up @@ -56,7 +56,7 @@ private function doGet(CacheItemPoolInterface $pool, string $key, callable $call
if ($recompute = $ctime && $expiry && $expiry <= ($now = microtime(true)) - $ctime / 1000 * $beta * log(random_int(1, PHP_INT_MAX) / PHP_INT_MAX)) {
// force applying defaultLifetime to expiry
$item->expiresAt(null);
$this->logger && $this->logger->info('Item "{key}" elected for early recomputation {delta}s before its expiration', [
$logger && $logger->info('Item "{key}" elected for early recomputation {delta}s before its expiration', [
'key' => $key,
'delta' => sprintf('%.1f', $expiry - $now),
]);
Expand Down

0 comments on commit 3786d4e

Please sign in to comment.