diff options
Diffstat (limited to 'Omni/Task/Core.hs')
| -rw-r--r-- | Omni/Task/Core.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs index 3a5dd49..d9ea98c 100644 --- a/Omni/Task/Core.hs +++ b/Omni/Task/Core.hs @@ -1005,3 +1005,12 @@ incrementRetryAttempt tid = do let newAttempt = retryAttempt ctx + 1 setRetryContext ctx {retryAttempt = newAttempt} pure newAttempt + +-- | Log activity to the task_activity table +logActivity :: Text -> ActivityStage -> Maybe Text -> IO () +logActivity tid stage metadata = + withDb <| \conn -> + SQL.execute + conn + "INSERT INTO task_activity (task_id, stage, message, metadata) VALUES (?, ?, ?, ?)" + (tid, show stage, Nothing :: Maybe Text, metadata) |
