Minor changes

This commit is contained in:
Loïc Guégan 2023-08-25 11:59:44 +02:00
parent 2bc5f2c00f
commit 8350d7e977

View file

@ -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,