From 8371ca3e94c0079636b32fdca0777faacdbbcb39 Mon Sep 17 00:00:00 2001 From: Simon Kelly Date: Mon, 9 Oct 2023 16:00:54 +0200 Subject: [PATCH] stale_timeout and max_runtime go from minutes to seconds --- docs/data_model.md | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/data_model.md b/docs/data_model.md index 10b3d65..0735660 100644 --- a/docs/data_model.md +++ b/docs/data_model.md @@ -51,7 +51,8 @@ The main attributes or a task are: `max_runtime` -: This value represents the number of seconds a task can run for before being placed in the 'error' state. +: This value can be used in conjunction with task actions and monitors to trigger actions if a task + exceeds its expected runtime. The value is in seconds. `stale_timeout` @@ -173,13 +174,15 @@ modified again (with the potential exception of 'stale'). : The task has been cancelled. A task may take on this state at any point. + +#### Other states + `stale` -: The task has become stale. This will happen if the task has not reached one of the other terminal +: The task has become stale. This will happen if the task has not reached one of the terminal states AND the duration since it's last update exceeds the tasks `stale_timeout` value (seconds). The - transition to this state is managed by Task Badger automatically. - - Tasks can also become stale if they exceed their maximum runtime as set by `max_runtime` (seconds). + transition to this state is managed by Task Badger automatically. A task in this state may transition + to any other state via an update. ## Task Actions @@ -211,7 +214,19 @@ Here is an example of an action: } ``` -### Action Trigger Examples +### Action Triggers + +An action trigger is a comma-separated list of trigger points. Each trigger point is one of the following: + +* A numeric value which is matched against the task `value`. +* A percentage value which is matched against the task `value_percent`. +* A task status which is matched against the task `status`. +* A special value `max_runtime_exeeded` which is matched when the task exceeds its `max_runtime` value. + +Numeric and percentage trigger points can also be prefixed with `*/` to indicate that the trigger should +fire at regular intervals. For example, `*/50%` will fire at 0%, 50% and 100%. + +Examples: | Trigger | Trigger Fire Points | |-----------------------|------------------------------------------------------------------------------|