{% from "leeuwenhoek/_macros.html" import duration, time_ago, json_tree, retry_button, retry_of_link with context %} {% macro status(s) -%} {%- set cls = {'finished': 'is-success', 'failed': 'is-danger', 'queued': 'is-info', 'deferred': 'is-warning', 'scheduled': 'is-warning'}.get(s, '') -%} {{ s }} {%- endmacro %} {% macro head() %}FunctionQueueStatusDurationWhen{% endmacro %} {% macro row(e) %} {{ e.content.function }} {{ e.content.queue }} {{ status(e.content.status) }} {{ duration(e.content.duration_ms) if e.content.event == 'perform' else '—' }} {{ time_ago(e.created_at) }} {% endmacro %} {% macro summary(e) %}{{ e.content.function }} {{ status(e.content.status) }}{% if e.content.event == 'perform' %} {{ duration(e.content.duration_ms) }}{% endif %}{% endmacro %} {% macro detail(e) %} {% set c = e.content %}

Function

{{ c.function }}

Queue

{{ c.queue }}

Status

{{ status(c.status) }}

{% if e.content.event == 'perform' %}

Duration

{{ c.duration_ms | lw_duration }}

{% endif %}

Job {{ c.job_id }} · {{ 'Dispatch and executions' if e.content.event == 'perform' else 'Executions' }} of this job {%- if e.parent_batch_id %} · Enqueued by batch {{ e.parent_batch_id[:8] }}{% endif %} {{- retry_of_link(e) }}

{% if c.error %}
{{ c.error['class'] }}: {{ c.error.message }}
{% endif %} {{ retry_button(e) }} {% if c.args_redacted %}

Some arguments were redacted or truncated.

{% endif %}
{{ json_tree(c.args, true) }}
{% endmacro %}