Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b7ccf10

Browse filesBrowse files
[Cache] Improve resiliency when calling doFetch() in AbstractTrait
1 parent bef15ce commit b7ccf10
Copy full SHA for b7ccf10

File tree

Expand file treeCollapse file tree

1 file changed

+10
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-4
lines changed

‎src/Symfony/Component/Cache/Traits/AbstractTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Traits/AbstractTrait.php
+10-4Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,11 @@ public function clear()
108108
try {
109109
if ($cleared = $this->versioningIsEnabled) {
110110
$namespaceVersion = 2;
111-
foreach ($this->doFetch(array('@'.$this->namespace)) as $v) {
112-
$namespaceVersion = 1 + (int) $v;
111+
try {
112+
foreach ($this->doFetch(array('@'.$this->namespace)) as $v) {
113+
$namespaceVersion = 1 + (int) $v;
114+
}
115+
} catch (\Exception $e) {
113116
}
114117
$namespaceVersion .= ':';
115118
$cleared = $this->doSave(array('@'.$this->namespace => $namespaceVersion), 0);
@@ -236,8 +239,11 @@ private function getId($key)
236239

237240
if ($this->versioningIsEnabled && '' === $this->namespaceVersion) {
238241
$this->namespaceVersion = '1:';
239-
foreach ($this->doFetch(array('@'.$this->namespace)) as $v) {
240-
$this->namespaceVersion = $v;
242+
try {
243+
foreach ($this->doFetch(array('@'.$this->namespace)) as $v) {
244+
$this->namespaceVersion = $v;
245+
}
246+
} catch (\Exception $e) {
241247
}
242248
}
243249

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.