Implemented sleep command to update sleep delay on agent

This commit is contained in:
Jakob Friedl
2025-05-28 10:39:30 +02:00
parent c03592c7fd
commit 4397f728de
11 changed files with 80 additions and 36 deletions

View File

@@ -0,0 +1,14 @@
import os, strutils, strformat
import ../types
proc taskSleep*(delay: int): tuple[output: TaskResult, status: TaskStatus] =
echo fmt"Sleeping for {$delay} seconds."
try:
sleep(delay * 1000)
return ("\n", Completed)
except CatchableError as err:
return (fmt"An error occured: {err.msg}" & "\n", Failed)