Make "include update info" part of the cache key
This commit is contained in:
parent
580155abe7
commit
5ca6ec7ead
|
@ -152,8 +152,10 @@ class AppSettingsController extends Controller {
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function listApps($category = 0, $includeUpdateInfo = true) {
|
public function listApps($category = 0, $includeUpdateInfo = true) {
|
||||||
if(!is_null($this->cache->get('listApps-'.$category))) {
|
$cacheName = 'listApps-' . $category . '-' . (int) $includeUpdateInfo;
|
||||||
$apps = $this->cache->get('listApps-'.$category);
|
|
||||||
|
if(!is_null($this->cache->get($cacheName))) {
|
||||||
|
$apps = $this->cache->get($cacheName);
|
||||||
} else {
|
} else {
|
||||||
switch ($category) {
|
switch ($category) {
|
||||||
// installed apps
|
// installed apps
|
||||||
|
@ -241,7 +243,7 @@ class AppSettingsController extends Controller {
|
||||||
return $app;
|
return $app;
|
||||||
}, $apps);
|
}, $apps);
|
||||||
|
|
||||||
$this->cache->set('listApps-'.$category, $apps, 300);
|
$this->cache->set($cacheName, $apps, 300);
|
||||||
|
|
||||||
return ['apps' => $apps, 'status' => 'success'];
|
return ['apps' => $apps, 'status' => 'success'];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue