From 32d654d979d9ed7d45873c165b294e0599373229 Mon Sep 17 00:00:00 2001 From: dantecatalfamo Date: Thu, 19 Dec 2024 10:46:42 -0500 Subject: [PATCH] Add note on lastRun not getting updated --- cmd/osquery-perf/agent.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/osquery-perf/agent.go b/cmd/osquery-perf/agent.go index 9ed721976772..8a1a7d534088 100644 --- a/cmd/osquery-perf/agent.go +++ b/cmd/osquery-perf/agent.go @@ -779,6 +779,12 @@ func (a *agent) runLoop(i int, onlyAlreadyEnrolled bool) { now := time.Now().Unix() prevCount := a.countBuffered() + // NOTE The goroutine that pulls in new configurations + // MAY replace this map if it happens to run at the + // exact same time. The result would be. The result + // would be that the query lastRun does not get + // updated and cause the query to run more times than + // expected. queryData := a.scheduledQueryData queryData.Range(func(key, value any) bool { queryName := key.(string)