|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
import logger from '@server/logger';
|
|
|
|
|
import type { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import rateLimit from 'axios-rate-limit';
|
|
|
|
@ -38,6 +39,10 @@ class ExternalAPI {
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (process.env.HTTPS_PROXY) {
|
|
|
|
|
logger.debug(`Using proxy from env var ${process.env.HTTPS_PROXY}`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (options.rateLimit) {
|
|
|
|
|
this.axios = rateLimit(this.axios, {
|
|
|
|
|
maxRequests: options.rateLimit.maxRequests,
|
|
|
|
|