Commit faa4b32b authored by Joao Pedro Lopes's avatar Joao Pedro Lopes
Browse files
parent e8d20e4e
Pipeline #3118403 passed with stages
in 10 minutes and 45 seconds
...@@ -337,6 +337,24 @@ class JobBuilder: ...@@ -337,6 +337,24 @@ class JobBuilder:
if max_time_in_queue is not None: if max_time_in_queue is not None:
expiration_time = time.time() + max_time_in_queue expiration_time = time.time() + max_time_in_queue
if max_time_in_queue is not None and self.params["bring_online"] > 0:
# Ensure that the bringonline and expiration delta is respected
timeout_delta = seconds_from_value(
app.config.get("fts3.BringOnlineAndExpirationDelta", None)
)
if timeout_delta is not None:
log.debug(
"Will enforce BringOnlineAndExpirationDelta="
+ str(timeout_delta)
+ "s"
)
if max_time_in_queue - self.params["bring_online"] < timeout_delta:
raise BadRequest(
"Bringonline and Expiration timeout must be at least "
+ str(timeout_delta)
+ " seconds apart"
)
if self.params["overwrite"]: if self.params["overwrite"]:
overwrite_flag = "Y" overwrite_flag = "Y"
elif self.params["overwrite_on_retry"]: elif self.params["overwrite_on_retry"]:
......
...@@ -276,6 +276,8 @@ def seconds_from_value(value): ...@@ -276,6 +276,8 @@ def seconds_from_value(value):
return int(value) * 60 return int(value) * 60
elif suffix == "h": elif suffix == "h":
return int(value) * 3600 return int(value) * 3600
elif suffix == "d":
return int(value) * 3600 * 24
else: else:
return None return None
except Exception: except Exception:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment