mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update MediaService, return empty array if cantt find status
This commit is contained in:
parent
44b32d8bb6
commit
c2910e5d42
1 changed files with 3 additions and 0 deletions
|
@ -19,6 +19,9 @@ class MediaService
|
||||||
public static function get($statusId)
|
public static function get($statusId)
|
||||||
{
|
{
|
||||||
$status = Status::find($statusId);
|
$status = Status::find($statusId);
|
||||||
|
if(!$status) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
$ttl = $status->created_at->lt(now()->subMinutes(30)) ? 129600 : 30;
|
$ttl = $status->created_at->lt(now()->subMinutes(30)) ? 129600 : 30;
|
||||||
return Cache::remember(self::CACHE_KEY.$statusId, $ttl, function() use($status) {
|
return Cache::remember(self::CACHE_KEY.$statusId, $ttl, function() use($status) {
|
||||||
if(!$status) {
|
if(!$status) {
|
||||||
|
|
Loading…
Reference in a new issue