Fix AdminNotificationService crashing on string throttle_minutes config
env('ERROR_NOTIFICATION_THROTTLE_MINUTES', 15) returns the literal string
"15" from production's .env (env() doesn't cast numeric strings), which
Carbon 3.11's addMinutes() rejects with a TypeError. That crash happened
before the throttle-dedup cache write, so it silently masked the *original*
exception on every notify-worthy error, indefinitely (discovered while
investigating a missing workshop-registration email — the real SMTP error
was hidden behind this crash). Cast to (int).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,7 @@ class AdminNotificationService
|
||||
}
|
||||
|
||||
$errorKey = $this->getErrorKey($exception);
|
||||
$throttleMinutes = config('libra.notifications.throttle_minutes', 15);
|
||||
$throttleMinutes = (int) config('libra.notifications.throttle_minutes', 15);
|
||||
|
||||
if (Cache::has($errorKey)) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user