feat: add rate limiting, retry with backoff, and max count cap
- Add configurable request delay between paginated API calls (default 1.5s) - Add retry with exponential backoff on HTTP 429 and Twitter error code 88 - Add hard max count cap (default 200, absolute ceiling 500) - Add rateLimit config section with requestDelay, maxRetries, retryBaseDelay, maxCount - Add normalization tests for rateLimit config
This commit is contained in:
@@ -12,7 +12,7 @@ def test_cli_user_command_works_with_client_factory(monkeypatch) -> None:
|
||||
def fetch_user(self, screen_name: str) -> UserProfile:
|
||||
return UserProfile(id="1", name="Alice", screen_name=screen_name)
|
||||
|
||||
monkeypatch.setattr("twitter_cli.cli._get_client", lambda: FakeClient())
|
||||
monkeypatch.setattr("twitter_cli.cli._get_client", lambda config=None: FakeClient())
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, ["user", "alice"])
|
||||
assert result.exit_code == 0
|
||||
|
||||
Reference in New Issue
Block a user