diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-03-31 16:24:53 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-03-31 16:24:53 +0200 |
commit | 9d2f8aa717826c1db8f8ec5f49a4128af3651edb (patch) | |
tree | 0b8b7fa177140cc2f9e5badb9ac66d4c65e1c529 /lib/filecache.php | |
parent | b72d7f1ab324aa5669a1cce69564ff7b10551084 (diff) | |
download | nextcloud-server-9d2f8aa717826c1db8f8ec5f49a4128af3651edb.tar.gz nextcloud-server-9d2f8aa717826c1db8f8ec5f49a4128af3651edb.zip |
send more progress updates when scanning large folders
Diffstat (limited to 'lib/filecache.php')
-rw-r--r-- | lib/filecache.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/filecache.php b/lib/filecache.php index 86d865ed9f3..59b0fb1b503 100644 --- a/lib/filecache.php +++ b/lib/filecache.php @@ -469,6 +469,10 @@ class OC_FileCache{ * @param string root (optionak) */ public static function scan($path,$eventSource=false,&$count=0,$root=''){ + if($eventSource){ + $eventSource->send('scanning',array('file'=>$path,'count'=>$count)); + } + $lastSend=$count; if(!$root){ $view=OC_Filesystem::getView(); }else{ @@ -482,13 +486,15 @@ class OC_FileCache{ if($filename != '.' and $filename != '..'){ $file=$path.'/'.$filename; if($view->is_dir($file.'/')){ - if($eventSource){ - $eventSource->send('scanning',array('file'=>$file,'count'=>$count)); - } self::scan($file,$eventSource,$count,$root); }else{ $totalSize+=self::scanFile($file,$root); $count++; + if($count>$lastSend+25){ + if($eventSource){ + $eventSource->send('scanning',array('file'=>$path,'count'=>$count)); + } + } } } } |