"""
return self.data.finished_at
+ @property
+ def timeout(self):
+ """
+ The timeout for this jobs
+ """
+ return self.data.timeout
+
+ @property
+ def times_out_in(self):
+ """
+ The remaining time until the timeout ends
+ """
+ if not self.is_running():
+ return
+
+ # Return nothing if no timeout is configured
+ if not self.timeout:
+ return
+
+ # Return the remaining time
+ return self.timeout - self.duration
+
def assign(self, builder):
"""
Assigns this job to a builder
+{% import datetime %}
+
{% for job in sorted(jobs) %}
{% set build = job.build %}
<div class="level-left">
<div class="level-item">
{{ format_time(job.duration) }}
+
+ {# If the job is approaching its timeout, we will show a warning #}
+ {% if job.times_out_in and job.times_out_in <= datetime.timedelta(hours=1) %}
+ / {{ format_time(job.timeout) }}
+ {% end %}
</div>
</div>