Skip to content

Commit fa81408

Browse files
committed
add cooldown cache config
1 parent d2f0890 commit fa81408

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

config/error-mailer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@
99
'disabledOn' => [
1010
//
1111
],
12+
13+
'cacheCooldown' => 10, // in minutes
1214
];

resources/views/error.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# {{ $exception ? $exception->getLine() : "" }}
1313

1414
## URL :
15-
# {{ request()->url() ?? "" }}
15+
# {{ url(request()->getPathInfo()) ?? "" }}
1616

1717
## Trace :
1818
{{ $exception || $stackTrace ? $stackTrace : "" }}

src/Listeners/NotifyAdminOfError.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function handle($event)
4040
$errorHash = md5($event->context['exception']->getMessage() . $event->context['exception']->getFile());
4141

4242
$cacheKey = 'error_mailer_' . $errorHash;
43-
$coolDownPeriod = 15;
43+
$coolDownPeriod = config('error-mailer.cacheCooldown') ?? 10;
4444

4545
if (!Cache::has($cacheKey)) {
4646
Mail::to($recipient)->send(new ErrorOccurred($event->context['exception']));

0 commit comments

Comments
 (0)