diff options
| author | Loic Guegan <loic.guegan@mailbox.org> | 2023-08-25 11:59:44 +0200 |
|---|---|---|
| committer | Loic Guegan <loic.guegan@mailbox.org> | 2023-08-25 11:59:44 +0200 |
| commit | 8350d7e977ff836e96ee53907cedc91a01814271 (patch) | |
| tree | 94bc357a254a7befee0c91f8080aa6deddcb92c9 | |
| parent | 2bc5f2c00fe9a078f402d45e7fc344d2064aa53d (diff) | |
Minor changes
| -rw-r--r-- | src/publisher.c | 5 |
1 files 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, |
