Commit Graph

9 Commits

Author SHA1 Message Date
perennial 198258b641 Remove unused funcs in token_manager_test 2024-09-24 16:28:53 +10:00
perennial 32a52d4f29 Remove unused functions in token_manager 2024-09-24 00:37:13 +10:00
perennial 9bab56f6dd proxy checker: fix staticcheck issues 2024-09-21 19:18:52 +10:00
perennial 4c0cb79470 Run make fmt 2024-09-19 20:04:19 +10:00
perennial 5c35d87371 Edit settings in token_manager_test.go 2024-09-19 20:03:46 +10:00
perennial c0aaedfc3b Add test suite for token_manager
This commit introduces a new file token_manager_test.go containing
unit tests for the token_manager package.

The test suite covers various aspects, including initialisation,
token selection methods, status updates, fallback mechanisms, and
concurrent access.
2024-09-19 19:51:24 +10:00
perennial bc19f485a2 Add separate API request level backoff mechanism
Implement new backoff settings for API requests, distinct from token
management backoff.

Update config, core request handling, and documentation to reflect the
new API request backoff mechanism. Refactor TokenManager to use the
manager's baseTimeout instead of individual token timeouts.
2024-09-19 16:27:22 +10:00
perennial 31a801ac34 Add inline comments to token_manager.go 2024-09-18 14:52:57 +10:00
perennial 54314d465c Implement token management and request retry system
Introduce a new TokenManager to handle token rotation, status
tracking, and automatic retries with exponential backoff for API
requests. This change aims to improve the reliability API
interactions by intelligently managing tokens and gracefully
handling request failures.

Update API request functions to utilise the new TokenManager. This
commit also adds configuration options for max retries, base timeout,
and max backoff time to fine-tune the retry behavior.
2024-09-18 14:49:18 +10:00