mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Handle 429s for gmail
This commit is contained in:
parent
633537570f
commit
396c5ec21b
@ -65,8 +65,20 @@ class GmailTransport extends AbstractTransport
|
|||||||
|
|
||||||
$body->setRaw($this->base64_encode($bcc_list.$message->toString()));
|
$body->setRaw($this->base64_encode($bcc_list.$message->toString()));
|
||||||
|
|
||||||
$service->users_messages->send('me', $body, []);
|
try{
|
||||||
|
$service->users_messages->send('me', $body, []);
|
||||||
|
}
|
||||||
|
catch(Google\Service\Exception $e) {
|
||||||
|
|
||||||
|
/* Need to slow down */
|
||||||
|
if($e->getCode() == '429') {
|
||||||
|
|
||||||
|
sleep(5);
|
||||||
|
$service->users_messages->send('me', $body, []);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function base64_encode($data)
|
private function base64_encode($data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user