{% from "leeuwenhoek/_macros.html" import duration, time_ago, json_tree, retry_button, retry_of_link with context %} {#- A job entry is either a run (root of its own batch) or, with `dispatched`, the dispatch of a task recorded in the batch that dispatched it, linking to the run's batch. -#} {% macro state_tag(c) -%} {%- set cls = {'SUCCESS': 'is-success', 'FAILURE': 'is-danger', 'RETRY': 'is-warning', 'DISPATCHED': 'is-info'}.get(c.status, '') -%} {{ c.status | lower }} {%- endmacro %} {% macro job_link(c) -%} {%- if c.dispatched and c.job_batch_id %} View job{% endif -%} {%- endmacro %} {% macro head() %}TaskStatusAttemptQueueDurationWhen{% endmacro %} {% macro row(e) %} {% set c = e.content %} {{ c.name }} {{ state_tag(c) }}{{ job_link(c) }} {{ c.get('attempt') or '—' }} {{ c.queue or '—' }} {{ duration(c.get('duration_ms')) }} {{ time_ago(e.created_at) }} {% endmacro %} {% macro summary(e) %}{{ e.content.name }} {{ state_tag(e.content) }} {{ duration(e.content.get('duration_ms')) }}{% endmacro %} {% macro detail(e) %} {% set c = e.content %}

Task

{{ c.name }}

Status

{{ state_tag(c) }}

{% if not c.dispatched %}

Attempt

{{ c.attempt }}{% if c.max_retries is not none %} / {{ c.max_retries + 1 }}{% endif %}

Duration

{{ c.duration_ms | lw_duration }}

{% endif %}

Queue

{{ c.queue or '—' }}

Task id {{ c.task_id }} {%- if c.eager %} · eager{% endif %} {%- if c.worker %} · worker {{ c.worker }}{% endif %} {%- if c.eta %} · ETA {{ c.eta }}{% endif %} {%- if c.dispatched and c.job_batch_id %} · View job{% endif %} {%- if e.parent_batch_id and not c.dispatched %} · Dispatched by{% endif %} {{- retry_of_link(e) }}

{% if c.exception %}
{{ c.exception['class'] }}: {{ c.exception.message }}
{% endif %} {{ retry_button(e) }} {% if c.retry_reason %}
Retried: {{ c.retry_reason }}
{% endif %}
{{ json_tree(c.args, true) }}
{% if not c.dispatched %}{% endif %}
{% endmacro %}