mirror of
https://github.com/SophiaAtkinson/steamwidgets-web.git
synced 2025-06-27 06:07:40 -07:00
Cache config for workshop
This commit is contained in:
@ -52,14 +52,13 @@ class SteamCache {
|
|||||||
*/
|
*/
|
||||||
public static function cachedSteamWorkshop($itemid)
|
public static function cachedSteamWorkshop($itemid)
|
||||||
{
|
{
|
||||||
$cache_driver = env('CACHE_DRIVER', null);
|
$cache = config('cache');
|
||||||
$cache_duration = env('CACHE_DURATION', 123);
|
|
||||||
|
|
||||||
if ($cache_driver === 'db') {
|
if ($cache->driver === 'db') {
|
||||||
return json_decode(CacheModel::remember('steam_workshop_' . $itemid, $cache_duration, function() use ($itemid) {
|
return json_decode(CacheModel::remember('steam_workshop_' . $itemid, $cache->duration, function() use ($itemid) {
|
||||||
return json_encode(SteamWorkshop::querySteamData($itemid));
|
return json_encode(SteamWorkshop::querySteamData($itemid));
|
||||||
}));
|
}));
|
||||||
} else if ($cache_driver === 'redis') {
|
} else if ($cache->driver === 'redis') {
|
||||||
throw new \Exception('Not implemented yet.');
|
throw new \Exception('Not implemented yet.');
|
||||||
} else {
|
} else {
|
||||||
return SteamWorkshop::querySteamData($itemid);
|
return SteamWorkshop::querySteamData($itemid);
|
||||||
|
Reference in New Issue
Block a user