]> source.dussan.org Git - nextcloud-server.git/commitdiff
use db transitions for collection scanner
authorRobin Appelman <icewind1991@gmail.com>
Sun, 31 Jul 2011 18:25:13 +0000 (20:25 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Sun, 31 Jul 2011 18:25:13 +0000 (20:25 +0200)
apps/media/lib_scanner.php

index e3cb2f051cea3e63a5afccaa4aa4a042d1699e3a..f788562fdbf87995d3d3da74d612e705e729db7c 100644 (file)
@@ -37,6 +37,7 @@ class OC_MEDIA_SCANNER{
         * @return int the number of songs found
         */
        public static function scanFolder($path){
+               OC_DB::beginTransaction();
                if (OC_Filesystem::is_dir($path)) {
                        $songs=0;
                        if ($dh = OC_Filesystem::opendir($path)) {
@@ -59,6 +60,7 @@ class OC_MEDIA_SCANNER{
                }else{
                        $songs=0;
                }
+               OC_DB::commit();
                return $songs;
        }