Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.later_retry_secs = int(self.options.get(CONFIG_LATER_RETRY_SECS.key, CONFIG_LATER_RETRY_SECS.default)) or 60
# Size of the request cache
self.cache_size = int(self.options.get(CONFIG_CACHE_SIZE.key, CONFIG_CACHE_SIZE.default))
# TTL of the request cache (millis before we give up on a request lookup)
self.cache_ttl = int(self.options.get(CONFIG_CACHE_TTL.key, CONFIG_CACHE_TTL.default))
# Limit to the number of queries we'll answer for unfinished searchers (count before giving up on them)
self.max_retries = int(self.options.get(CONFIG_MAX_RETRIES.key, CONFIG_MAX_RETRIES.default))
# IDs and their results are maintained in a cache so that we can set
# an upper bound on the number of in-progress and recent lookups.
self.cache = TTLCache(maxsize=self.cache_size, ttl=self.cache_ttl)
# Helper component does event dispatch work
self.async_helper = CustomThreatServiceHelper(self)
(self.helper_thread, self.bridge) = self.async_helper.start()
urls = ["{0}/{1}".format(self.channel, e) for e in self.events()]
LOG.info("Web handler for %s", ", ".join(urls))
def __init__(self, maincomponent):
super(CustomThreatServiceHelper, self).__init__()
self.maincomponent = maincomponent