From e1e2720c7d08b118205752b4e6e2bc29aca6d126 Mon Sep 17 00:00:00 2001 From: Ihor Sikachyna Date: Mon, 25 Nov 2024 12:19:25 -0500 Subject: [PATCH] Fix incorrect comparison for OnlyIfUnique processing mode --- tracker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracker.go b/tracker.go index 92ac614..29585b7 100644 --- a/tracker.go +++ b/tracker.go @@ -100,7 +100,7 @@ func trackerThread(config QueryConfig, mongo mongodb.MongoDB, stopRequest chan a existingDocument, err := mongo.GetLastDocumentFiltered(config.Name, "timestamp", bson.D{{Key: "value", Value: res}, {Key: "version", Value: config.Version}}) if err != nil { fmt.Printf("Failed the search for an existing record in MongoDB: %v", err) - } else if existingDocument != nil { + } else if existingDocument == nil { onlyIfUniquePassed = true } }