8000 [Cache][WebProfiler] fix collecting cache stats with sub-requests + a… · symfony/symfony@132bba6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 132bba6

Browse files
committed
[Cache][WebProfiler] fix collecting cache stats with sub-requests + allow clearing calls
1 parent 020664e commit 132bba6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/Symfony/Component/Cache/Adapter/TraceableAdapter.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,12 @@ public function reset()
204204

205205
public function getCalls()
206206
{
207-
try {
208-
return $this->calls;
209-
} finally {
210-
$this->calls = array();
211-
}
207+
return $this->calls;
208+
}
209+
210+
public function clearCalls()
211+
{
212+
$this->calls = array();
212213
}
213214

214215
protected function start($name)

src/Symfony/Component/Cache/DataCollector/CacheDataCollector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ public function reset()
5757
{
5858
$this->data = array();
5959
foreach ($this->instances as $instance) {
60-
// Calling getCalls() will clear the calls.
61-
$instance->getCalls();
60+
$instance->clearCalls();
6261
}
6362
}
6463

0 commit comments

Comments
 (0)
0