Skip to content

Commit

Permalink
fix: use GET instead of HEAD to speed up connection test
Browse files Browse the repository at this point in the history
Interestingly, a HEAD to a JobData table (like done in the connection test)
last approx > 15 sec whereas a GET ~ 1 sec. Therefore, we use GET again.
  • Loading branch information
brotkrueml committed Sep 3, 2024
1 parent 66043ca commit f82fd72
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Classes/Controller/TableTestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function __invoke(ServerRequestInterface $request): ResponseInterface
}

$this->restClientFactory->create($connection)->request(
'HEAD',
'GET',
\sprintf('application/jobdata/tables/%s/datasets', $table->tableGuid),
);
return $this->buildResponse();
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Controller/TableTestControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function invokeReturnsResponseWithErrorWhenExceptionIsThrown(): void

$this->clientStub
->method('request')
->with('HEAD', 'application/jobdata/tables/sometableguid/datasets')
->with('GET', 'application/jobdata/tables/sometableguid/datasets')
->willThrowException(new \Exception('some exception message'));
$this->restClientFactoryMock
->method('create')
Expand Down

0 comments on commit f82fd72

Please sign in to comment.