mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Expose clearing the profiles and fix it
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
parent
20ea9a2535
commit
fda3af7915
3 changed files with 11 additions and 0 deletions
|
|
@ -99,6 +99,7 @@ class FileProfilerStorage {
|
|||
$iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::CHILD_FIRST);
|
||||
|
||||
foreach ($iterator as $file) {
|
||||
$file = $file->getPathInfo();
|
||||
if (is_file($file)) {
|
||||
unlink($file);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -102,4 +102,8 @@ class Profiler implements IProfiler {
|
|||
public function setEnabled(bool $enabled): void {
|
||||
$this->enabled = $enabled;
|
||||
}
|
||||
|
||||
public function clear(): void {
|
||||
$this->storage->purge();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,4 +98,10 @@ interface IProfiler {
|
|||
* @since 24.0.0
|
||||
*/
|
||||
public function collect(Request $request, Response $response): IProfile;
|
||||
|
||||
/**
|
||||
* Clear the stored profiles
|
||||
* @since 25.0.0
|
||||
*/
|
||||
public function clear(): void;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue