mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Slow down Gmail API requests
This commit is contained in:
parent
8032155b05
commit
ae3a5e72eb
@ -213,12 +213,18 @@ abstract class QueryFilters
|
||||
public function with_trashed($value)
|
||||
{
|
||||
|
||||
if($value == 'true'){
|
||||
if($value == 'false'){
|
||||
|
||||
$this->builder->withTrashed();
|
||||
return $this->builder->where('is_deleted', 0);
|
||||
|
||||
}
|
||||
|
||||
// if($value == 'true'){
|
||||
|
||||
// $this->builder->withTrashed();
|
||||
|
||||
// }
|
||||
|
||||
return $this->builder;
|
||||
|
||||
}
|
||||
|
@ -212,6 +212,8 @@ class NinjaMailerJob implements ShouldQueue
|
||||
|
||||
$google->getClient()->setAccessToken(json_encode($user->oauth_user_token));
|
||||
|
||||
//need to slow down gmail requests otherwise we hit 429's
|
||||
sleep(1);
|
||||
}
|
||||
catch(\Exception $e) {
|
||||
$this->logMailError('Gmail Token Invalid', $this->company->clients()->first());
|
||||
@ -225,9 +227,6 @@ class NinjaMailerJob implements ShouldQueue
|
||||
* just for this request.
|
||||
*/
|
||||
|
||||
// config(['mail.driver' => 'gmail']);
|
||||
// (new MailServiceProvider(app()))->register();
|
||||
|
||||
$token = $user->oauth_user_token->access_token;
|
||||
|
||||
$this->nmo
|
||||
|
Loading…
x
Reference in New Issue
Block a user