mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 05:54:38 -04:00
Fixes for tests
This commit is contained in:
parent
228f3af4b9
commit
4a968e739c
@ -73,7 +73,6 @@ class GmailTransport extends AbstractTransport
|
|||||||
/* Need to slow down */
|
/* Need to slow down */
|
||||||
if($e->getCode() == '429') {
|
if($e->getCode() == '429') {
|
||||||
|
|
||||||
sleep(rand(5,10));
|
|
||||||
nlog("429 google - retrying ");
|
nlog("429 google - retrying ");
|
||||||
$service->users_messages->send('me', $body, []);
|
$service->users_messages->send('me', $body, []);
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
|
|
||||||
public function backoff()
|
public function backoff()
|
||||||
{
|
{
|
||||||
return [30, 60, 180, 240];
|
return [5, 10, 30, 240];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handle()
|
public function handle()
|
||||||
@ -445,7 +445,6 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
$message->getHeaders()->addTextHeader('gmailtoken', $token);
|
$message->getHeaders()->addTextHeader('gmailtoken', $token);
|
||||||
});
|
});
|
||||||
|
|
||||||
sleep(rand(1,3));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -472,7 +471,6 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
|
|
||||||
$google->getClient()->setAccessToken(json_encode($user->oauth_user_token));
|
$google->getClient()->setAccessToken(json_encode($user->oauth_user_token));
|
||||||
|
|
||||||
sleep(rand(1,6));
|
|
||||||
}
|
}
|
||||||
catch(\Exception $e) {
|
catch(\Exception $e) {
|
||||||
$this->logMailError('Gmail Token Invalid', $this->company->clients()->first());
|
$this->logMailError('Gmail Token Invalid', $this->company->clients()->first());
|
||||||
|
@ -59,7 +59,7 @@ class EmailMailer implements ShouldQueue
|
|||||||
|
|
||||||
public function backoff()
|
public function backoff()
|
||||||
{
|
{
|
||||||
return [30, 60, 180, 240];
|
return [10, 30, 60, 240];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
@ -379,7 +379,6 @@ class EmailMailer implements ShouldQueue
|
|||||||
$message->getHeaders()->addTextHeader('gmailtoken', $token);
|
$message->getHeaders()->addTextHeader('gmailtoken', $token);
|
||||||
});
|
});
|
||||||
|
|
||||||
sleep(rand(1,3));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -406,7 +405,6 @@ class EmailMailer implements ShouldQueue
|
|||||||
|
|
||||||
$google->getClient()->setAccessToken(json_encode($user->oauth_user_token));
|
$google->getClient()->setAccessToken(json_encode($user->oauth_user_token));
|
||||||
|
|
||||||
sleep(rand(2,4));
|
|
||||||
}
|
}
|
||||||
catch(\Exception $e) {
|
catch(\Exception $e) {
|
||||||
$this->logMailError('Gmail Token Invalid', $this->email_service->company->clients()->first());
|
$this->logMailError('Gmail Token Invalid', $this->email_service->company->clients()->first());
|
||||||
|
@ -433,7 +433,7 @@ class BaseApiTest extends TestCase
|
|||||||
'X-API-SECRET' => config('ninja.api_secret'),
|
'X-API-SECRET' => config('ninja.api_secret'),
|
||||||
'X-API-TOKEN' => $this->low_token,
|
'X-API-TOKEN' => $this->low_token,
|
||||||
])->get('/api/v1/companies/'.$this->company->hashed_id)
|
])->get('/api/v1/companies/'.$this->company->hashed_id)
|
||||||
->assertStatus(401);
|
->assertStatus(403);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user