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:
parent
7d06027922
commit
1a8105f3c6
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue