]> source.dussan.org Git - nextcloud-server.git/commitdiff
Retrieve storage numeric id earlier when still available
authorVincent Petry <pvince81@owncloud.com>
Mon, 13 Oct 2014 13:52:48 +0000 (15:52 +0200)
committerVincent Petry <pvince81@owncloud.com>
Mon, 13 Oct 2014 13:52:48 +0000 (15:52 +0200)
The numeric id is only available before the storage entry is deleted, so
get it at that time.

lib/private/files/cache/storage.php

index a38656d849948dd8531f9521dc433e47d5e8f491..d7d57811a7dd01eef715d260cf08b04ab69d9e49 100644 (file)
@@ -105,10 +105,10 @@ class Storage {
         */
        public static function remove($storageId) {
                $storageId = self::adjustStorageId($storageId);
+               $numericId = self::getNumericStorageId($storageId);
                $sql = 'DELETE FROM `*PREFIX*storages` WHERE `id` = ?';
                \OC_DB::executeAudited($sql, array($storageId));
 
-               $numericId = self::getNumericStorageId($storageId);
                if (!is_null($numericId)) {
                        $sql = 'DELETE FROM `*PREFIX*filecache` WHERE `storage` = ?';
                        \OC_DB::executeAudited($sql, array($numericId));