WIP: Try to resolve issue where the running db transaction causes the trashbin move between storages to fail

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2020-09-23 17:21:47 +02:00
parent 7d06027922
commit 1a8105f3c6
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 3 additions and 2 deletions

View File

@ -287,7 +287,6 @@ class Trashbin {
$connection = \OC::$server->getDatabaseConnection();
$connection->beginTransaction();
$trashStorage->getUpdater()->renameFromStorage($sourceStorage, $sourceInternalPath, $trashInternalPath);
try {
$moveSuccessful = true;
@ -304,7 +303,9 @@ class Trashbin {
\OC::$server->getLogger()->error('Couldn\'t move ' . $file_path . ' to the trash bin', ['app' => 'files_trashbin']);
}
if ($sourceStorage->file_exists($sourceInternalPath)) { // failed to delete the original file, abort
$trashStorage->getUpdater()->renameFromStorage($sourceStorage, $sourceInternalPath, $trashInternalPath);
if (!$moveSuccessful && $sourceStorage->file_exists($sourceInternalPath)) { // failed to delete the original file, abort
if ($sourceStorage->is_dir($sourceInternalPath)) {
$sourceStorage->rmdir($sourceInternalPath);
} else {