Skip to content
Snippets Groups Projects
Commit 98bb1131 authored by Thomas Juerges's avatar Thomas Juerges
Browse files

Add new parameter to get_progress

Setting only_last24h to True allows now to query only for requests that have been active during the last 24h.  This avoids most of the time the nasty gateway time-out when the stager is busy with too many internal retries.
parent 4ef52f61
No related branches found
No related tags found
No related merge requests found
......@@ -157,16 +157,20 @@ def reschedule(stageid):
except xmlrpclib.Error as e:
raise Exception(remove_credentials_from_exception(e))
def get_progress(status=None, exclude=False):
""" Get a detailed list of all running requests and their current progress.
def get_progress(status=None, exclude=False, only_last24h=False):
""" Get a detailed list of all requests and their current progress.
As a normal user, this only returns your own requests.
:param status: If set to a valid status then only requests with that
status are returned.
:param exclude: If set to True then the requests with status 'status' are
excluded.
:param only_last24h: When True only requests that have been active in the last 24h get returned. This can avoid the nasty time-outs that occasionally happen when the stager is stuck with too many retried requests.
"""
try:
all_requests = proxy.LtaStager.getprogress()
if only_last24h is False:
all_requests = proxy.LtaStager.getprogress()
else:
all_requests = proxy.LtaStager.getprogress(True, 0)
except xmlrpclib.Error as e:
raise Exception(remove_credentials_from_exception(e))
if status is not None and isinstance(status, string_types):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment