Update NotificationService, handle empty epoch. Fixes #4689

pull/4690/head
Daniel Supernault 2023-10-10 19:13:19 -06:00
rodzic e4d3b19642
commit 457d5454f8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 23740873EE6F76A1
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -49,6 +49,9 @@ class NotificationService {
public static function getEpochId($months = 6)
{
return Cache::remember(self::EPOCH_CACHE_KEY . $months, 1209600, function() use($months) {
if(Notification::count() === 0) {
return 0;
}
return Notification::where('created_at', '>', now()->subMonths($months))->first()->id;
});
}