Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

Commit

Permalink
Fix Cache Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kimbtech committed Sep 28, 2020
1 parent 3daf9e8 commit db59741
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/Utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
class Utilities {

const VERSION = 'v1.0.2';
const VERSION = 'v1.0.3';

/**
* OS Consts
Expand Down
9 changes: 7 additions & 2 deletions core/sync/ServerAccessCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,13 @@ public function cachedGetFile( string $file, string $device ) : ?array {
* Returns array with data or null, if uncached
*/
public function setGetFile( string $file, string $device, array $value ) : void {
$this->cache->setValue(['file',$device,$file,'data'], $value);
$this->cache->setValue(['file',$device,$file,'time'], time());
if(!$this->cache->isValue(['file',$device])){
$this->cache->setValue(['file',$device], array());
}
$this->cache->setValue(['file',$device,$file], array(
'data' => $value,
'time' => time()
));
}
}

Expand Down

0 comments on commit db59741

Please sign in to comment.