ClearGeneratedAvatarCacheJob.php 614 B

1234567891011121314151617181920212223
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OC\Repair;
  7. use OC\Avatar\AvatarManager;
  8. use OCP\AppFramework\Utility\ITimeFactory;
  9. use OCP\BackgroundJob\QueuedJob;
  10. class ClearGeneratedAvatarCacheJob extends QueuedJob {
  11. protected AvatarManager $avatarManager;
  12. public function __construct(ITimeFactory $timeFactory, AvatarManager $avatarManager) {
  13. parent::__construct($timeFactory);
  14. $this->avatarManager = $avatarManager;
  15. }
  16. public function run($argument) {
  17. $this->avatarManager->clearCachedAvatars();
  18. }
  19. }