Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CarnetApp/CarnetNextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhie <phie@phie.ovh>2020-05-02 01:14:02 +0300
committerPhie <phie@phie.ovh>2020-05-02 01:14:25 +0300
commitbeebfc01af6343575ff64b8d442d891cd307bee9 (patch)
treef1cb77f14e4c8f63613c3930e68311092acbc34a
parentd4451616d5c3fc52c67ce0e2ff0379973939c906 (diff)
fix search from cache
-rw-r--r--lib/Misc/Search.php27
1 files changed, 12 insertions, 15 deletions
diff --git a/lib/Misc/Search.php b/lib/Misc/Search.php
index e6d272d..92dc080 100644
--- a/lib/Misc/Search.php
+++ b/lib/Misc/Search.php
@@ -71,22 +71,18 @@ public function startSearch($query, $from) {
private function searchInCache($query){
$cache = new CacheManager($this->db, $this->CarnetFolder);
$metadataFromCache = $cache->search($query);
- if($this->searchCache){
- foreach($metadataFromCache as $path => $mTime){
- $this->output->writeln('found in '.$path);
+ foreach($metadataFromCache as $path => $mTime){
+ $this->output->writeln('found in '.$path);
+
+ $file = array();
+ $file['name'] = "none";
+ $file['path'] = $path;
+ $file['isDir'] = false;
+ $file['mtime'] = $mTime;
+
+ array_push($this->data, $file);
+ array_push($this->pathArray, $path);
- $file = array();
- $file['name'] = "none";
- $file['path'] = $path;
- $file['isDir'] = false;
- $file['mtime'] = $mTime;
-
- array_push($this->data, $file);
- array_push($this->pathArray, $path);
-
- }
- // $this->searchCache->putContent(json_encode($this->data));
-
}
}
@@ -156,6 +152,7 @@ private function search($relativePath, $folder, $query, $curDepth){
}
} catch(\OCP\Files\NotFoundException $e) {
} catch(\PhpZip\Exception\ZipException $e){
+ } catch(Exception $e){
}
}
if(time() - $this->startTime>=2){