2025-05-28 10:39:30 +02:00
|
|
|
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)
|
2025-05-28 11:14:30 +02:00
|
|
|
return ("", Completed)
|
2025-05-28 10:39:30 +02:00
|
|
|
|
|
|
|
|
except CatchableError as err:
|
|
|
|
|
return (fmt"An error occured: {err.msg}" & "\n", Failed)
|