Skip to content

Commit

Permalink
Delete external storage cache after deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Petry committed Oct 13, 2014
1 parent 4b9465b commit cd0ec08
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions apps/files_external/lib/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,21 @@ public static function removeMountPoint($mountPoint, $mountType, $applicable, $i
}
$mountPoint = \OC\Files\Filesystem::normalizePath($mountPoint);
$mountPoints = self::readData($isPersonal ? OCP\User::getUser() : NULL);

$options = $mountPoints[$mountType][$applicable][$mountPoint];
if (isset($options['options'])) {
$options['options'] = self::decryptPasswords($options['options']);
}
if ($isPersonal) {
$mount = new \OCA\Files_External\PersonalMount($options['class'], $mountPoint, $options['options'], $loader);
} else{
$mount = new \OC\Files\Mount\Mount($options['class'], $mountPoint, $options['options'], $loader);
}
$storageId = $mount->getStorageId();
if (!empty($storageId)) {
// delete storage and cache entries
\OC\Files\Cache\Storage::remove($storageId);
}
// Remove mount point
unset($mountPoints[$mountType][$applicable][$mountPoint]);
// Unset parent arrays if empty
Expand Down

0 comments on commit cd0ec08

Please sign in to comment.