Restructure the proxy checking logic to use a ticker for periodic checks
when a non-zero interval is set. Improve handling of zero interval case
by waiting for a stop signal. Improve stop mechanism and initialisation
of stopChan.
Also introduce a new test file proxy_checker_test.go for unit testing.
This commit introduces a new PIXIVFE_REPO_URL configuration option,
allowing users to specify a custom repository URL.
The about page now uses this configurable URL, and the configuration
loading process has been updated to validate and handle the new option.
Documentation has been updated to reflect these changes.
Modify the REVISION variable to include both commit date and hash.
Update config package to parse and store revision components separately.
Modify about page and routes to display more detailed revision information.
This commit restores the ability to use a user-provided token when
making API requests and gives it precedence over the default token
provided by tokenManager.
Additionally, the function GetPixivToken has been renamed to
GetUserToken for clarity.
Simplify the conditional logic in the Init function by using an early
return when optionSaveResponse is false. Move the MaxRecordedCount
assignment and directory creation outside the conditional block to
improve code structure and readability.
Introduce a new ResponseSaveLocation config option to flexibly store
API responses during development. Move InDevelopment flag to a
dedicated "Development options" section in the config struct.
Update audit package to use the new configurable save location instead
of a hardcoded path.
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.
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.
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.
Modify the server startup process to wait for the first proxy check to
complete before initialising the server.
Add logging to provide visibility into the proxy checker initialisation
process.