Skip to content

Commit

Permalink
Make sure the time out is in place
Browse files Browse the repository at this point in the history
  • Loading branch information
JC5 committed Nov 29, 2024
1 parent fc44b53 commit 4b771d5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Http/Controllers/Import/Spectre/ConnectionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public function index()
// check if already has the correct customer:
$hasCustomer = false;
$request = new ListCustomersRequest($url, $appId, $secret);

$request->setTimeOut(config('importer.connection.timeout'));

$list = $request->get();
$identifier = null;

Expand All @@ -95,6 +98,7 @@ public function index()
if (false === $hasCustomer) {
// create new one
$request = new PostCustomerRequest($url, $appId, $secret);
$request->setTimeOut(config('importer.connection.timeout'));
$request->identifier = config('spectre.customer_identifier', 'default_ff3_customer');

/** @var PostCustomerResponse $customer */
Expand All @@ -121,6 +125,7 @@ public function index()

app('log')->debug('About to get connections.');
$request = new ListConnectionsRequest($url, $appId, $secret);
$request->setTimeOut(config('importer.connection.timeout'));
$request->customer = $identifier;
$list = $request->get();

Expand All @@ -145,6 +150,7 @@ public function post(Request $request)
$appId = SpectreSecretManager::getAppId();
$secret = SpectreSecretManager::getSecret();
$newToken = new PostConnectSessionsRequest($url, $appId, $secret);
$newToken->setTimeOut(config('importer.connection.timeout'));
$newToken->customer = $configuration->getIdentifier();
$newToken->url = route('011-connections.callback');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ private function getAccountType(int $accountId): string
$url = SecretManager::getBaseUrl();
app('log')->debug(sprintf('Going to download account #%d', $accountId));
$request = new GetAccountRequest($url, $token);
$request->setTimeOut(config('importer.connection.timeout'));
$request->setId($accountId);

// @var GetAccountResponse $result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ protected static function getAccountDetails(Account $account): Account
$url = config('nordigen.url');
$accessToken = TokenManager::getAccessToken();
$request = new GetAccountInformationRequest($url, $accessToken, $account->getIdentifier());
$request->setTimeOut(config('importer.connection.timeout'));
// @var ArrayResponse $response

try {
Expand Down
1 change: 1 addition & 0 deletions app/Services/Shared/Import/Routine/ApiSubmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ private function searchField(string $field, string $value): int
$url = SecretManager::getBaseUrl();
$token = SecretManager::getAccessToken();
$request = new GetSearchTransactionsRequest($url, $token);
$request->setTimeOut(config('importer.connection.timeout'));
$request->setQuery($query);

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ private function refreshConnection(): void
$appId = SpectreSecretManager::getAppId();
$secret = SpectreSecretManager::getSecret();
$put = new PutRefreshConnectionRequest($url, $appId, $secret);
$put->setTimeOut(config('importer.connection.timeout'));
$put->setConnection($this->configuration->getConnection());
$response = $put->put();
if ($response instanceof ErrorResponse) {
Expand Down
1 change: 1 addition & 0 deletions app/Support/Internal/CollectsAccounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ protected function getSpectreAccounts(Configuration $configuration): array
$appId = SpectreSecretManager::getAppId();
$secret = SpectreSecretManager::getSecret();
$spectreList = new SpectreGetAccountsRequest($url, $appId, $secret);
$spectreList->setTimeOut(config('importer.connection.timeout'));
$spectreList->connection = $configuration->getConnection();

/** @var GetAccountsResponse $spectreAccounts */
Expand Down

0 comments on commit 4b771d5

Please sign in to comment.