Skip to content

Commit

Permalink
Remove retry duplicate code for Slack client
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrech committed Dec 11, 2024
1 parent ee37ef7 commit 01a83cd
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/Slack/UserExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use JoliCode\SecretSanta\Model\Group;
use JoliCode\SecretSanta\Model\User;
use JoliCode\Slack\Api\Model\ObjsUser;
use JoliCode\Slack\Exception\SlackErrorResponse;

class UserExtractor
{
Expand Down Expand Up @@ -44,17 +43,6 @@ public function extractAll(string $token): array
'limit' => 200,
'cursor' => $cursor,
]);
} catch (SlackErrorResponse $slackErrorResponse) {
if ('ratelimited' === $slackErrorResponse->getErrorCode()) {
sleep(30);

$response = $this->clientFactory->getClientForToken($token)->usersList([
'limit' => 200,
'cursor' => $cursor,
]);
} else {
throw new UserExtractionFailedException(SlackApplication::APPLICATION_CODE, 'Could not fetch members in team.', $slackErrorResponse);
}
} catch (\Throwable $t) {
throw new UserExtractionFailedException(SlackApplication::APPLICATION_CODE, 'Could not fetch members in team.', $t);
}
Expand Down

0 comments on commit 01a83cd

Please sign in to comment.