From 8350d7e977ff836e96ee53907cedc91a01814271 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Fri, 25 Aug 2023 11:59:44 +0200 Subject: [PATCH] Minor changes --- src/publisher.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/publisher.c b/src/publisher.c index bf1d480..5b01c7c 100644 --- a/src/publisher.c +++ b/src/publisher.c @@ -102,12 +102,13 @@ int main(int argc, char *argv[]) { //----- Start logging printf("Logger started [client=%s,interval=%ds]\n", client, loginterval); while (!__stop) { - interval = INTERVAL(loginterval); - // Log current interval + // Wait for next queue to be available: queue_id = (queue_id + 1) >= MAX_QUEUES ? 0 : (queue_id + 1); // Busy wait: while (queues[queue_id].issending) { }; + // Get current interval + interval = INTERVAL(loginterval); // Write msg header: *queues[queue_id].msg = '\0'; sprintf(queues[queue_id].msg, "%s\n%s\n%s\n%ld\n", ZMQ_TOKEN, key, client,