summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-11-14 20:20:20 +0100
committerBjoern Schiessle <bjoern@schiessle.org>2017-11-14 20:26:18 +0100
commita923e755e67e0e14dee824877afa9e6425b38379 (patch)
tree2e89139d3a9e075cde3698eb29c12ec167769f80 /lib
parenta3f86b99e95ca71799df5f08b18ceb7e77f82b66 (diff)
downloadnextcloud-server-a923e755e67e0e14dee824877afa9e6425b38379.tar.gz
nextcloud-server-a923e755e67e0e14dee824877afa9e6425b38379.zip
check if the user still exists before we try to cleanup the previews
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Repair/NC11/CleanPreviewsBackgroundJob.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/private/Repair/NC11/CleanPreviewsBackgroundJob.php b/lib/private/Repair/NC11/CleanPreviewsBackgroundJob.php
index 9efe01508a6..e713f4dc63a 100644
--- a/lib/private/Repair/NC11/CleanPreviewsBackgroundJob.php
+++ b/lib/private/Repair/NC11/CleanPreviewsBackgroundJob.php
@@ -30,6 +30,7 @@ use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
use OCP\ILogger;
+use OCP\IUserManager;
class CleanPreviewsBackgroundJob extends QueuedJob {
/** @var IRootFolder */
@@ -44,6 +45,9 @@ class CleanPreviewsBackgroundJob extends QueuedJob {
/** @var ITimeFactory */
private $timeFactory;
+ /** @var IUserManager */
+ private $userManager;
+
/**
* CleanPreviewsBackgroundJob constructor.
*
@@ -51,19 +55,26 @@ class CleanPreviewsBackgroundJob extends QueuedJob {
* @param ILogger $logger
* @param IJobList $jobList
* @param ITimeFactory $timeFactory
+ * @param IUserManager $userManager
*/
public function __construct(IRootFolder $rootFolder,
ILogger $logger,
IJobList $jobList,
- ITimeFactory $timeFactory) {
+ ITimeFactory $timeFactory,
+ IUserManager $userManager) {
$this->rootFolder = $rootFolder;
$this->logger = $logger;
$this->jobList = $jobList;
$this->timeFactory = $timeFactory;
+ $this->userManager = $userManager;
}
public function run($arguments) {
$uid = $arguments['uid'];
+ if (!$this->userManager->userExists($uid)) {
+ $this->logger->info('User no longer exists, skip user ' . $uid);
+ return;
+ }
$this->logger->info('Started preview cleanup for ' . $uid);
$empty = $this->cleanupPreviews($uid);