Cleaned up parts of the serialization by removing redundant code.

This commit is contained in:
Jakob Friedl
2025-07-28 21:29:47 +02:00
parent 882579b3cb
commit 0d54b3e64b
16 changed files with 185 additions and 199 deletions

View File

@@ -2,7 +2,7 @@ import terminal, strformat, strutils, sequtils, tables, json, times, base64, sys
import ../[utils, globals]
import ../db/database
import ../task/packer
import ../message/packer
import ../../common/[types, utils]
#[
@@ -58,11 +58,9 @@ proc getTasks*(checkinData: seq[byte]): seq[seq[byte]] =
# Update the last check-in date for the accessed agent
cq.agents[agentId].latestCheckin = cast[int64](timestamp).fromUnix().local()
# if not cq.dbUpdateCheckin(agent.toUpperAscii, now().format("dd-MM-yyyy HH:mm:ss")):
# return nil
# Return tasks
for task in cq.agents[agentId].tasks.mitems: # Iterate over mutable items in order to modify GMAC
for task in cq.agents[agentId].tasks.mitems: # Iterate over agents as mutable items in order to modify GMAC tag
let taskData = cq.serializeTask(task)
result.add(taskData)