From 0491f3aa08b1a2dc277be8c13d69a3c3b0986882 Mon Sep 17 00:00:00 2001 From: Simon Kelly Date: Thu, 28 Sep 2023 16:05:38 +0200 Subject: [PATCH 1/2] update API schema with change from 'minutes' to 'seconds' --- taskbadger.yaml | 6 +++--- taskbadger/internal/models/patched_task_request.py | 2 +- taskbadger/internal/models/task.py | 2 +- taskbadger/internal/models/task_request.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/taskbadger.yaml b/taskbadger.yaml index 3fb5acf..1d262c1 100644 --- a/taskbadger.yaml +++ b/taskbadger.yaml @@ -728,7 +728,7 @@ components: minimum: 1 nullable: true description: Maximum time to allow between task updates before considering - the task stale. (seconds) + the task stale. Only applies when task is in a running state. (seconds) StatusEnum: enum: - pending @@ -825,7 +825,7 @@ components: minimum: 1 nullable: true description: Maximum time to allow between task updates before considering - the task stale. (seconds) + the task stale. Only applies when task is in a running state. (seconds) url: type: string readOnly: true @@ -906,7 +906,7 @@ components: minimum: 1 nullable: true description: Maximum time to allow between task updates before considering - the task stale. (seconds) + the task stale. Only applies when task is in a running state. (seconds) required: - name securitySchemes: diff --git a/taskbadger/internal/models/patched_task_request.py b/taskbadger/internal/models/patched_task_request.py index afb65b0..57c1485 100644 --- a/taskbadger/internal/models/patched_task_request.py +++ b/taskbadger/internal/models/patched_task_request.py @@ -30,7 +30,7 @@ class PatchedTaskRequest: max_runtime (Union[Unset, None, int]): Maximum duration the task can be running for before being considered failed. (seconds) stale_timeout (Union[Unset, None, int]): Maximum time to allow between task updates before considering the task - stale. (seconds) + stale. Only applies when task is in a running state. (seconds) """ name: Union[Unset, str] = UNSET diff --git a/taskbadger/internal/models/task.py b/taskbadger/internal/models/task.py index 113dad0..fb101c8 100644 --- a/taskbadger/internal/models/task.py +++ b/taskbadger/internal/models/task.py @@ -38,7 +38,7 @@ class Task: max_runtime (Union[Unset, None, int]): Maximum duration the task can be running for before being considered failed. (seconds) stale_timeout (Union[Unset, None, int]): Maximum time to allow between task updates before considering the task - stale. (seconds) + stale. Only applies when task is in a running state. (seconds) """ id: str diff --git a/taskbadger/internal/models/task_request.py b/taskbadger/internal/models/task_request.py index 951b01f..cc67866 100644 --- a/taskbadger/internal/models/task_request.py +++ b/taskbadger/internal/models/task_request.py @@ -30,7 +30,7 @@ class TaskRequest: max_runtime (Union[Unset, None, int]): Maximum duration the task can be running for before being considered failed. (seconds) stale_timeout (Union[Unset, None, int]): Maximum time to allow between task updates before considering the task - stale. (seconds) + stale. Only applies when task is in a running state. (seconds) """ name: str From cf36b286f309605d2d2882942c695eb7411bbd9d Mon Sep 17 00:00:00 2001 From: Simon Kelly Date: Thu, 28 Sep 2023 16:06:02 +0200 Subject: [PATCH 2/2] update docstrings --- taskbadger/sdk.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/taskbadger/sdk.py b/taskbadger/sdk.py index d11d3ef..23998a3 100644 --- a/taskbadger/sdk.py +++ b/taskbadger/sdk.py @@ -78,8 +78,8 @@ def create_task( value: The current 'value' of the task. value_max: The maximum value the task is expected to achieve. data: Custom task data. - max_runtime: Maximum expected runtime (minutes). - stale_timeout: Maximum allowed time between updates (minutes). + max_runtime: Maximum expected runtime (seconds). + stale_timeout: Maximum allowed time between updates (seconds). actions: Task actions. monitor_id: ID of the monitor to associate this task with. @@ -128,8 +128,8 @@ def update_task( value: The current 'value' of the task. value_max: The maximum value the task is expected to achieve. data: Custom task data. - max_runtime: Maximum expected runtime (minutes). - stale_timeout: Maximum allowed time between updates (minutes). + max_runtime: Maximum expected runtime (seconds). + stale_timeout: Maximum allowed time between updates (seconds). actions: Task actions. Returns: