stagingapi: @memoize to get_ignored_requests() and get_open_requests().

Based on usage neither of these are refreshed during a single run, but
are called multiple times in function chains.
This commit is contained in:
Jimmy Berry 2017-03-17 17:16:49 -05:00
parent 791d25046d
commit e1626db5e7

View File

@ -493,6 +493,7 @@ class StagingAPI(object):
return True
return False
@memoize(session=True)
def get_ignored_requests(self):
ignore = self.load_file_content('{}:Staging'.format(self.project), 'dashboard', 'ignored_requests')
if ignore is None:
@ -503,6 +504,7 @@ class StagingAPI(object):
ignore = yaml.dump(ignore_requests, default_flow_style=False)
self.save_file_content('{}:Staging'.format(self.project), 'dashboard', 'ignored_requests', ignore)
@memoize(session=True)
def get_open_requests(self):
"""
Get all requests with open review for staging project