Skip to content

Commit 7aeaa8d

Browse files
committed
Update getTasks and uid/taskUid (#188)
1 parent 39ee52a commit 7aeaa8d

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
@@ -73,7 +73,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7373
$output->writeln('<info>Creating index '.$index['name'].' for '.$entityClassName.'</info>');
7474

7575
$task = $this->searchClient->createIndex($index['name']);
76-
$this->searchClient->waitForTask($task['uid']);
76+
$this->searchClient->waitForTask($task['taskUid']);
7777
$indexInstance = $this->searchClient->index($index['name']);
7878

7979
if (isset($index['settings']) && is_array($index['settings'])) {
@@ -85,7 +85,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8585
}
8686

8787
$task = $indexInstance->{$method}($value);
88-
$task = $indexInstance->getTask($task['uid']);
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)