From: Robin Appelman Date: Sun, 5 Feb 2012 00:23:04 +0000 (+0100) Subject: some improvements in file scanning X-Git-Tag: v4.0.0beta~244^2~88^2~1^2~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7c00aedc37cf039ec23c54429d5188ab7d219b7e;p=nextcloud-server.git some improvements in file scanning --- diff --git a/files/ajax/scan.php b/files/ajax/scan.php index f7e75d5f8ba..565275911b4 100644 --- a/files/ajax/scan.php +++ b/files/ajax/scan.php @@ -15,13 +15,19 @@ if(!$checkOnly){ //create the file cache if necesary if($force or !OC_FileCache::inCache('')){ if(!$checkOnly){ - OC_FileCache::scan('',false,$eventSource); + OC_DB::beginTransaction(); + OC_FileCache::scan('',$eventSource); + OC_DB::commit(); $eventSource->send('success',true); }else{ OC_JSON::success(array('data'=>array('done'=>true))); exit; } }else{ + if($checkOnly){ + OC_JSON::success(array('data'=>array('done'=>false))); + exit; + } if(isset($eventSource)){ $eventSource->send('success',false); }else{