Cache config for group

This commit is contained in:
Daniel Brendel 2024-04-05 22:35:23 +02:00
parent 33f4b1175c
commit fc0d1591ac
1 changed files with 4 additions and 5 deletions

View File

@ -71,14 +71,13 @@ class SteamCache {
*/
public static function cachedSteamGroup($group)
{
$cache_driver = env('CACHE_DRIVER', null);
$cache_duration = env('CACHE_DURATION', 123);
$cache = config('cache');
if ($cache_driver === 'db') {
return json_decode(CacheModel::remember('steam_group_' . $group, $cache_duration, function() use ($group) {
if ($cache->driver === 'db') {
return json_decode(CacheModel::remember('steam_group_' . $group, $cache->duration, function() use ($group) {
return json_encode(SteamGroup::querySteamData($group));
}));
} else if ($cache_driver === 'redis') {
} else if ($cache->driver === 'redis') {
throw new \Exception('Not implemented yet.');
} else {
return SteamGroup::querySteamData($group);