Update MediaService, return empty array if cantt find status

This commit is contained in:
Daniel Supernault 2021-12-12 19:33:20 -07:00
parent 44b32d8bb6
commit c2910e5d42
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -19,6 +19,9 @@ class MediaService
public static function get($statusId)
{
$status = Status::find($statusId);
if(!$status) {
return [];
}
$ttl = $status->created_at->lt(now()->subMinutes(30)) ? 129600 : 30;
return Cache::remember(self::CACHE_KEY.$statusId, $ttl, function() use($status) {
if(!$status) {