Skip to content

Commit

Permalink
refs #43 don't try to delete locked file
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
  • Loading branch information
Julien Veyssier committed Jan 6, 2021
1 parent 58f32d9 commit 5c234c2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
6 changes: 0 additions & 6 deletions lib/Service/GoogleDriveAPIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,6 @@ private function getFile(string $accessToken, string $userId, array $fileItem, a
}
} catch (\OCP\Lock\LockedException $e) {
$this->logger->warning('Google Drive error downloading file ' . $fileItem['name'] . ' : Impossible to unlock file', ['app' => $this->appName]);
if ($savedFile->isDeletable()) {
$savedFile->delete();
}
return null;
}
$res = $this->googleApiService->simpleDownload($accessToken, $userId, $fileUrl, $resource);
Expand Down Expand Up @@ -421,9 +418,6 @@ private function getFile(string $accessToken, string $userId, array $fileItem, a
}
} catch (\OCP\Lock\LockedException $e) {
$this->logger->warning('Google Drive error downloading file ' . $fileItem['name'] . ' : Impossible to unlock file', ['app' => $this->appName]);
if ($savedFile->isDeletable()) {
$savedFile->delete();
}
return null;
}
$res = $this->googleApiService->simpleDownload($accessToken, $userId, $fileUrl, $resource, $params);
Expand Down
3 changes: 0 additions & 3 deletions lib/Service/GooglePhotosAPIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,6 @@ private function getPhoto(string $accessToken, string $userId, array $photo, Nod
}
} catch (\OCP\Lock\LockedException $e) {
$this->logger->warning('Google API error downloading photo ' . $photoName . ' : Impossible to unlock file', ['app' => $this->appName]);
if ($savedFile->isDeletable()) {
$savedFile->delete();
}
return null;
}
$res = $this->googleApiService->simpleDownload($accessToken, $userId, $photoUrl, $resource);
Expand Down

0 comments on commit 5c234c2

Please sign in to comment.