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

Commit db59741

Browse files
committed
Fix Cache Bug
1 parent 3daf9e8 commit db59741

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

core/Utilities.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
class Utilities {
66

7-
const VERSION = 'v1.0.2';
7+
const VERSION = 'v1.0.3';
88

99
/**
1010
* OS Consts

core/sync/ServerAccessCache.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,13 @@ public function cachedGetFile( string $file, string $device ) : ?array {
7171
* Returns array with data or null, if uncached
7272
*/
7373
public function setGetFile( string $file, string $device, array $value ) : void {
74-
$this->cache->setValue(['file',$device,$file,'data'], $value);
75-
$this->cache->setValue(['file',$device,$file,'time'], time());
74+
if(!$this->cache->isValue(['file',$device])){
75+
$this->cache->setValue(['file',$device], array());
76+
}
77+
$this->cache->setValue(['file',$device,$file], array(
78+
'data' => $value,
79+
'time' => time()
80+
));
7681
}
7782
}
7883

0 commit comments

Comments
 (0)