- fixed some problems with "build system" index, #666

This commit is contained in:
Mark Friedrich
2018-09-02 01:18:09 +02:00
parent a86958abd6
commit 8da07199f4
2 changed files with 4 additions and 7 deletions

View File

@@ -905,7 +905,8 @@ abstract class BasicModel extends \DB\Cortex {
* @return bool
*/
public static function existsCacheValue(string $key, &$val = null){
return self::getF3()->exists($key, $val);
$cache = \Cache::instance();
return $cache->exists(self::getF3()->hash($key).'.var',$val);
}
/**

View File

@@ -102,10 +102,9 @@ abstract class BasicUniverseModel extends BasicModel {
$data = null;
if($hashKeyId = $this->getHashKey()){
$f3 = self::getF3();
$hashKeyTable = self::generateHashKeyTable($this->getTable());
if( !$f3->exists($hashKeyTable, $cachedData) ){
if( !self::existsCacheValue($hashKeyTable, $cachedData) ){
$cachedData = [];
}
@@ -113,11 +112,8 @@ abstract class BasicUniverseModel extends BasicModel {
$cachedData[] = $hashKeyId;
}
// value update does not update ttl -> delete key from cache and add again
$f3->clear($hashKeyId);
$f3->clear($hashKeyTable);
$data = $this->getData();
// straight into cache (no $f->set() ), no sync with hive here -> save ram
self::setCacheValue($hashKeyId, $data, self::CACHE_INDEX_EXPIRE_KEY);
self::setCacheValue($hashKeyTable, $cachedData, self::CACHE_INDEX_EXPIRE_KEY);