Try to better handle slack “too many requests” issue

This commit is contained in:
snipe 2020-08-14 16:10:22 -07:00
parent b5acca89d7
commit bcad49ce79
No known key found for this signature in database
GPG key ID: 10BFFDA3ED34B5AC

View file

@ -165,14 +165,24 @@ trait Loggable
$checkinClass = null;
if (method_exists($target, 'notify')) {
$target->notify(new static::$checkinClass($params));
try {
$target->notify(new static::$checkinClass($params));
} catch (\Exception $e) {
\Log::debug($e);
}
}
// Send to the admin, if settings dictate
$recipient = new \App\Models\Recipients\AdminRecipient();
if (($settings->admin_cc_email!='') && (static::$checkinClass!='')) {
$recipient->notify(new static::$checkinClass($params));
try {
$recipient->notify(new static::$checkinClass($params));
} catch (\Exception $e) {
\Log::debug($e);
}
}
return $log;