mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Properly clear cached avatars
Signed-off-by: jld3103 <jld3103yt@gmail.com>
This commit is contained in:
parent
44d7dbb33d
commit
b8286d2ead
1 changed files with 2 additions and 7 deletions
|
|
@ -161,13 +161,8 @@ class AvatarManager implements IAvatarManager {
|
|||
public function clearCachedAvatars() {
|
||||
$users = $this->config->getUsersForUserValue('avatar', 'generated', 'true');
|
||||
foreach ($users as $userId) {
|
||||
try {
|
||||
$folder = $this->appData->getFolder($userId);
|
||||
$folder->delete();
|
||||
} catch (NotFoundException $e) {
|
||||
$this->logger->debug("No cache for the user $userId. Ignoring...");
|
||||
}
|
||||
$this->config->setUserValue($userId, 'avatar', 'generated', 'false');
|
||||
// This also bumps the avatar version leading to cache invalidation in browsers
|
||||
$this->getAvatar($userId)->remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue