summaryrefslogtreecommitdiffstats
path: root/files/ajax/scan.php
diff options
context:
space:
mode:
Diffstat (limited to 'files/ajax/scan.php')
-rw-r--r--files/ajax/scan.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/files/ajax/scan.php b/files/ajax/scan.php
index dec949a819b..01236c83da1 100644
--- a/files/ajax/scan.php
+++ b/files/ajax/scan.php
@@ -2,15 +2,18 @@
require_once '../../lib/base.php';
+$eventSource=new OC_EventSource();
+
$force=isset($_GET['force']) and $_GET['force']=='true';
$checkOnly=isset($_GET['checkonly']) and $_GET['checkonly']=='true';
//create the file cache if necesary
if($force or !OC_FileCache::inCache('')){
if(!$checkOnly){
- OC_FileCache::scan('');
+ OC_FileCache::scan('',false,$eventSource);
}
- OC_JSON::success(array("data" => array( "done" => true)));
+ $eventSource->send('success',true);
}else{
- OC_JSON::success(array("data" => array( "done" => false)));
-} \ No newline at end of file
+ $eventSource->send('success',false);
+}
+$eventSource->close(); \ No newline at end of file