Skip to content

Commit 90f3227

Browse files
authored
Merge pull request #42 from b13/task/catch-sql-limit-error
[TASK] Catch error while flushing cache tags
2 parents a8997a8 + 54541bd commit 90f3227

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

Build/phpunit/FunctionalTestsBootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/*
34
* This file is part of the TYPO3 CMS project.
45
*

Build/phpunit/UnitTestsBootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/*
34
* This file is part of the TYPO3 CMS project.
45
*

Classes/Cache/Backend/ReverseProxyCacheBackend.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919

2020
use B13\Proxycachemanager\Provider\ProxyProviderInterface;
21+
use Psr\Log\LoggerAwareTrait;
2122
use TYPO3\CMS\Core\Cache\Backend\TransientBackendInterface;
2223
use TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend;
2324
use TYPO3\CMS\Core\Database\ConnectionPool;
@@ -30,6 +31,7 @@
3031
*/
3132
class ReverseProxyCacheBackend extends Typo3DatabaseBackend implements TransientBackendInterface
3233
{
34+
use LoggerAwareTrait;
3335
protected ProxyProviderInterface $reverseProxyProvider;
3436

3537
public function setReverseProxyProvider(ProxyProviderInterface $reverseProxyProvider)
@@ -113,7 +115,11 @@ public function flushByTags(array $tags)
113115
$this->reverseProxyProvider->flushCacheForUrls($urls);
114116
}
115117

116-
parent::flushByTags($tags);
118+
try {
119+
parent::flushByTags($tags);
120+
} catch (\Throwable $e) {
121+
$this->logger->error('Failed to flush ' . count($tags) . ' tags. SQL query limit exceeded. See the list of all tags ' . implode(', ', $tags));
122+
}
117123
}
118124

119125
/**

0 commit comments

Comments
 (0)