Skip to content

Commit

Permalink
Try to better handle slack “too many requests” issue
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Aug 14, 2020
1 parent b5acca8 commit bcad49c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app/Models/Loggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,24 @@ public function logCheckin($target, $note)
$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;
Expand Down

0 comments on commit bcad49c

Please sign in to comment.