Cache config for workshop

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

View File

@ -52,14 +52,13 @@ class SteamCache {
*/
public static function cachedSteamWorkshop($itemid)
{
$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_workshop_' . $itemid, $cache_duration, function() use ($itemid) {
if ($cache->driver === 'db') {
return json_decode(CacheModel::remember('steam_workshop_' . $itemid, $cache->duration, function() use ($itemid) {
return json_encode(SteamWorkshop::querySteamData($itemid));
}));
} else if ($cache_driver === 'redis') {
} else if ($cache->driver === 'redis') {
throw new \Exception('Not implemented yet.');
} else {
return SteamWorkshop::querySteamData($itemid);