Use minutes instead of seconds for cache_expiry

This commit is contained in:
DariusIII
2018-05-10 12:46:24 +02:00
parent ca5a2b5a17
commit cde4ef5f0e
15 changed files with 28 additions and 27 deletions
+4 -4
View File
@@ -187,7 +187,7 @@ class Category extends Model
->orderBy('count', 'desc')
->get();
$expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long'));
$expiresAt = Carbon::now()->addMinutes(config('nntmux.cache_expiry_long'));
Cache::put('recentlyadded', $recent, $expiresAt);
return $recent;
@@ -306,7 +306,7 @@ class Category extends Model
*/
public static function getChildren($categoryId)
{
$expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long'));
$expiresAt = Carbon::now()->addMinutes(config('nntmux.cache_expiry_long'));
$children = Cache::get(md5($categoryId));
if ($children !== null) {
return $children;
@@ -358,7 +358,7 @@ class Category extends Model
return $catIds;
}
$catIds = self::query()->whereIn('id', $ids)->get();
$expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long'));
$expiresAt = Carbon::now()->addMinutes(config('nntmux.cache_expiry_long'));
Cache::put('categoryids', $catIds, $expiresAt);
return $catIds;
@@ -444,7 +444,7 @@ class Category extends Model
$arr = $arrsql;
} else {
$arr = $sql->get()->toArray();
$expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long'));
$expiresAt = Carbon::now()->addMinutes(config('nntmux.cache_expiry_long'));
Cache::put(md5(implode(',', $excludedCats).implode(',', $roleExcludedCats)), $arr, $expiresAt);
}