diff options
author | Phie <phie@phie.ovh> | 2019-08-15 18:47:39 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2019-08-15 18:47:39 +0300 |
commit | e0cfa6cbd8c79a89e72376ab24ba7ace2cd6165b (patch) | |
tree | 3405d1ba1d3ea62dc5a7eab79a1f6fe445b7c21a /lib | |
parent | e6d59aa027f76af6cf136dd88eb561b773888d16 (diff) |
faster merge: ignore old db
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Controller/NoteController.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Controller/NoteController.php b/lib/Controller/NoteController.php index c3e8429..99d0248 100755 --- a/lib/Controller/NoteController.php +++ b/lib/Controller/NoteController.php @@ -281,8 +281,9 @@ public function mergeKeywordsDB() { $myDb = $this->getKeywordsDBFile(); $hasChanged = false; + $lastmod = $myDb->getMTime(); foreach($this->CarnetFolder->get("quickdoc/keywords/")->getDirectoryListing() as $inDB){ - if($inDB->getName() === $myDb->getName()){ + if($inDB->getName() === $myDb->getName()||$inDB->getMTime()<$lastmod){ continue; } $myDbContent = json_decode($myDb->getContent()); @@ -331,9 +332,10 @@ */ public function mergeRecentDB() { $myDb = $this->getRecentFile(); + $lastmod = $myDb->getMTime(); $hasChanged = false; foreach($this->CarnetFolder->get("quickdoc/recentdb/")->getDirectoryListing() as $inDB){ - if($inDB->getName() === $myDb->getName()){ + if($inDB->getName() === $myDb->getName()||$inDB->getMTime()<$lastmod){ continue; } $myDbContent = json_decode($myDb->getContent()); |