Adds more verbose error message and logs traceback when errors encountered at init.

This commit is contained in:
Johnny 2020-10-20 20:35:14 +00:00
parent 13eb713c20
commit eaa2b534ce

View file

@ -35,10 +35,10 @@ class Throttle(object):
try:
self.storage = caches['throttle']
except Exception as e:
logger.log_err(f'Throttle: {e}')
logger.log_trace("Throttle: Errors encountered; using default cache.")
self.storage = caches['default']
self.name = kwargs.get('name', 'ip-throttle')
self.name = kwargs.get('name', 'undefined-throttle')
self.limit = kwargs.get("limit", 5)
self.cache_size = kwargs.get('cache_size', self.limit)
self.timeout = kwargs.get("timeout", 5 * 60)