diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-09-22 12:36:15 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-10-10 13:26:40 +0200 |
commit | c9703827e048a733306d5b7a4fadbe51c23d23a0 (patch) | |
tree | c28f5c5e5d82a9ee79fb03df515fed768d6420aa /lib/private/Profiler | |
parent | 29af54f10d53f7e8ee5749324c299ac0775f09b0 (diff) | |
download | nextcloud-server-c9703827e048a733306d5b7a4fadbe51c23d23a0.tar.gz nextcloud-server-c9703827e048a733306d5b7a4fadbe51c23d23a0.zip |
Expose clearing the profiles and fix it
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'lib/private/Profiler')
-rw-r--r-- | lib/private/Profiler/FileProfilerStorage.php | 1 | ||||
-rw-r--r-- | lib/private/Profiler/Profiler.php | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/Profiler/FileProfilerStorage.php b/lib/private/Profiler/FileProfilerStorage.php index ce09ed51ed9..d583549332e 100644 --- a/lib/private/Profiler/FileProfilerStorage.php +++ b/lib/private/Profiler/FileProfilerStorage.php @@ -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 { diff --git a/lib/private/Profiler/Profiler.php b/lib/private/Profiler/Profiler.php index 8aa800fbc6d..9fd5e76d592 100644 --- a/lib/private/Profiler/Profiler.php +++ b/lib/private/Profiler/Profiler.php @@ -102,4 +102,8 @@ class Profiler implements IProfiler { public function setEnabled(bool $enabled): void { $this->enabled = $enabled; } + + public function clear(): void { + $this->storage->purge(); + } } |