mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 21:18:00 +01:00
Shift Cache methods to use seconds
To conform with PSR-16 Laravel 5.8 changed the cache expiration time from minutes to seconds. If you were passing an integer, Shift converted this to its integer equivalent in seconds. If you were passing a "minutes" variable, Shift converted this to the relative date time equivalent for readability.
This commit is contained in:
parent
27a4372fb8
commit
392f9ffd69
3 changed files with 3 additions and 3 deletions
|
@ -109,7 +109,7 @@ class StatsController extends ApiControllerBase
|
|||
|
||||
public function getTrackStats($id)
|
||||
{
|
||||
$cachedOutput = Cache::remember('track_stats'.$id, 5, function () use ($id) {
|
||||
$cachedOutput = Cache::remember('track_stats'.$id, 300, function () use ($id) {
|
||||
try {
|
||||
$track = Track::published()->findOrFail($id);
|
||||
} catch (ModelNotFoundException $e) {
|
||||
|
|
|
@ -387,7 +387,7 @@ class Track extends Model implements Searchable, Commentable, Favouritable
|
|||
{
|
||||
$trackData = Cache::remember(
|
||||
'popular_tracks'.$count.'-'.($allowExplicit ? 'explicit' : 'safe'),
|
||||
5,
|
||||
300,
|
||||
function () use ($allowExplicit, $count, $skip) {
|
||||
/*$query = static
|
||||
::published()
|
||||
|
|
|
@ -170,7 +170,7 @@ trait TrackCollection
|
|||
return 0;
|
||||
}
|
||||
|
||||
return Cache::remember($this->getCacheKey('filesize-'.$format), 1440, function () use ($tracks, $format) {
|
||||
return Cache::remember($this->getCacheKey('filesize-'.$format), 86400, function () use ($tracks, $format) {
|
||||
$size = 0;
|
||||
|
||||
// Check whether the format is lossless yet not all master files are lossless
|
||||
|
|
Loading…
Reference in a new issue