Skip to content

Commit

Permalink
Declare @throws in HandlesTasks delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
norkunas committed Dec 13, 2023
1 parent c5d217c commit a69c60a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Endpoints/Delegates/HandlesTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Meilisearch\Contracts\TasksQuery;
use Meilisearch\Contracts\TasksResults;
use Meilisearch\Endpoints\Tasks;
use Meilisearch\Exceptions\TimeOutException;

trait HandlesTasks
{
Expand Down Expand Up @@ -38,11 +39,17 @@ public function cancelTasks(CancelTasksQuery $options = null): array
return $this->tasks->cancelTasks($options);
}

/**
* @throws TimeOutException
*/
public function waitForTask($uid, int $timeoutInMs = 5000, int $intervalInMs = 50): array
{
return $this->tasks->waitTask($uid, $timeoutInMs, $intervalInMs);
}

/**
* @throws TimeOutException
*/
public function waitForTasks($uids, int $timeoutInMs = 5000, int $intervalInMs = 50): array
{
return $this->tasks->waitTasks($uids, $timeoutInMs, $intervalInMs);
Expand Down
3 changes: 3 additions & 0 deletions src/Endpoints/Tasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public function waitTask($taskUid, int $timeoutInMs, int $intervalInMs): array
throw new TimeOutException();
}

/**
* @throws TimeOutException
*/
public function waitTasks(array $taskUids, int $timeoutInMs, int $intervalInMs): array
{
$tasks = [];
Expand Down

0 comments on commit a69c60a

Please sign in to comment.