Skip to content

Commit 389c407

Browse files
authored
Update getTasks and uid/taskUid (#188)
1 parent 87a5edd commit 389c407

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Command/MeiliSearchCreateCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8484

8585
$task = $indexInstance->{$method}($value);
8686

87-
$indexInstance->waitForTask($task['uid']);
88-
$task = $indexInstance->getTask($task['uid']);
87+
$indexInstance->waitForTask($task['taskUid']);
88+
$task = $indexInstance->getTask($task['taskUid']);
8989

9090
if ('failed' === $task['status']) {
9191
throw new TaskException($task['error']);

src/Command/MeiliSearchImportCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
137137
$task = $indexInstance->{$method}($value);
138138

139139
// Get task information using uid
140-
$indexInstance->waitForTask($task['uid'], $responseTimeout);
141-
$task = $indexInstance->getTask($task['uid']);
140+
$indexInstance->waitForTask($task['taskUid'], $responseTimeout);
141+
$task = $indexInstance->getTask($task['taskUid']);
142142

143143
if ('failed' === $task['status']) {
144144
throw new TaskException($task['error']);
@@ -175,8 +175,8 @@ private function formatIndexingResponse(array $batch, int $responseTimeout): arr
175175
$indexInstance = $this->searchClient->index($indexName);
176176

177177
// Get task information using uid
178-
$indexInstance->waitForTask($apiResponse['uid'], $responseTimeout);
179-
$task = $indexInstance->getTask($apiResponse['uid']);
178+
$indexInstance->waitForTask($apiResponse['taskUid'], $responseTimeout);
179+
$task = $indexInstance->getTask($apiResponse['taskUid']);
180180

181181
if ('failed' === $task['status']) {
182182
throw new TaskException($task['error']);

tests/Integration/EventListener/DoctrineEventSubscriberTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public function testPreRemoveWithObjectId(): void
162162
*/
163163
private function waitForAllTasks(): void
164164
{
165-
$firstTask = $this->client->getTasks()['results'][0];
165+
$firstTask = $this->client->getTasks()->getResults()[0];
166166
$this->client->waitForTask($firstTask['uid']);
167167
}
168168
}

0 commit comments

Comments
 (0)