hotfix CCache and enable use cache
This commit is contained in:
1 parent
d5bdfbc33c
commit
1e7ba3faa6
2 files changed
+13
-10
No files matched your search
+9
-2
@@ -189,8 +189,15 @@ function getClientInfo() {
|
||||
* @return array|bool
|
||||
*/
|
||||
function getUserDevices($userId) {
|
||||
global $DB;
|
||||
$res = $DB->query('SELECT * FROM devices WHERE user="'.$userId.'"');
|
||||
$cacheId = md5('getUserDevices_'.$userId);
|
||||
if(CCache::checkCache($cacheId)){
|
||||
$res = CCache::getCache($cacheId);
|
||||
} else {
|
||||
global $DB;
|
||||
$res = $DB->query('SELECT * FROM devices WHERE user="'.$userId.'"');
|
||||
CCache::writeCache($cacheId, $res);
|
||||
}
|
||||
|
||||
if($res){
|
||||
return $res;
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user