Started rewriting JSON task to custom binary structure. Parsed and serialized task object into seq[byte]

This commit is contained in:
Jakob Friedl
2025-07-18 14:24:07 +02:00
parent 310ad82cc5
commit 5825ec91a1
28 changed files with 926 additions and 732 deletions

View File

@@ -3,7 +3,7 @@ import sequtils, strutils, times
import ./handlers
import ../utils
import ../../types
import ../../common/types
proc error404*(ctx: Context) {.async.} =
resp "", Http404
@@ -86,16 +86,13 @@ proc getTasks*(ctx: Context) {.async.} =
let
listener = ctx.getPathParams("listener")
agent = ctx.getPathParams("agent")
let tasksJson = getTasks(listener, agent)
# If agent/listener is invalid, return a 404 Not Found error code
if tasksJson == nil:
try:
let tasks = getTasks(listener, agent)
resp $tasks
except CatchableError:
resp "", Http404
# Return all currently active tasks as a JsonObject
resp jsonResponse(tasksJson)
#[
POST /{listener-uuid}/{agent-uuid}/{task-uuid}/results