Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GOLD-290 : Blacklisting of IPs in the Json RPC server which have caus…
…ed timeouts (#71) * feat(handlers): added a wrapped handler which logs and returns 500s in case of errors feat(middleware): removed unused test middleware feat(axios): added configurable axios timeout set to 5s feat(config): updated axios timeout to 3s docs(todo): added todo to add a blacklist feat: Add TTLMap for blacklisted IP entries The code changes introduce a new `TTLMap` class in the `utils` directory. This class is used to store blacklisted IP entries with a time-to-live (TTL) value. The TTLMap allows for the expiration of blacklisted IP entries after a certain period of time. This change is necessary to implement the feature of blacklisting IP addresses that cause timeouts. The `TTLMap` is used to store the blacklisted IP entries along with their expiration time. When a timeout occurs, the IP address is added to the `TTLMap` with a TTL value calculated based on the axios timeout configuration. This commit message follows the established convention of starting with a verb in the imperative form ("Add") and providing a concise and clear description of the changes made. feat: Update blacklisted IP entry expiration time and added logs. The code changes modify the `retainTimedOutEntriesForMillis` constant in the `api.ts` file. The value is updated to `config.axiosTimeoutInMs * 10` to increase the expiration time of blacklisted IP entries from 3 times the axios timeout to 10 times the axios timeout. This change is necessary to ensure that blacklisted IP entries remain in the `TTLMap` for a longer period of time before being expired. This allows for better handling of IP addresses that cause timeouts. This commit message follows the established convention of starting with a verb in the imperative form ("Update") and providing a concise and clear description of the changes made. feat: Increase expiration time of blacklisted IP entries The code changes update the `retainTimedOutEntriesForMillis` constant in the `api.ts` file. The value is changed to `config.axiosTimeoutInMs * 100` to increase the expiration time of blacklisted IP entries from 5 minutes to 50 minutes. This change is necessary to ensure that blacklisted IP entries remain in the `TTLMap` for a longer period of time before being expired. This allows for better handling of IP addresses that cause timeouts. * feat : add counters for blacklistedIp
- Loading branch information