request_splitter: expose age thresholds to config.
This commit is contained in:
parent
f6c31d7f59
commit
9ea9a50c35
@ -10,9 +10,11 @@ class RequestSplitter(object):
|
|||||||
self.api = api
|
self.api = api
|
||||||
self.requests = requests
|
self.requests = requests
|
||||||
self.in_ring = in_ring
|
self.in_ring = in_ring
|
||||||
|
self.config = conf.config[self.api.project]
|
||||||
|
|
||||||
# 55 minutes to avoid two staging bot loops of 30 minutes
|
# 55 minutes to avoid two staging bot loops of 30 minutes
|
||||||
self.request_age_threshold = 55 * 60
|
self.request_age_threshold = int(self.config.get('splitter-request-age-threshold', 55 * 60))
|
||||||
self.staging_age_max = 8 * 60 * 60
|
self.staging_age_max = int(self.config.get('splitter-staging-age-max', 8 * 60 * 60))
|
||||||
|
|
||||||
self.requests_ignored = self.api.get_ignored_requests()
|
self.requests_ignored = self.api.get_ignored_requests()
|
||||||
|
|
||||||
@ -203,7 +205,7 @@ class RequestSplitter(object):
|
|||||||
|
|
||||||
# Use specified list of stagings, otherwise only empty, letter stagings.
|
# Use specified list of stagings, otherwise only empty, letter stagings.
|
||||||
if len(stagings) == 0:
|
if len(stagings) == 0:
|
||||||
whitelist = conf.config[self.api.project].get('splitter-whitelist')
|
whitelist = self.config.get('splitter-whitelist')
|
||||||
if whitelist:
|
if whitelist:
|
||||||
stagings = whitelist.split()
|
stagings = whitelist.split()
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user