centreon / centreon-stream-connector-scripts

Scripts for Centreon Stream Connector
15 stars 22 forks source link

fix return code when payload is empty #233

Closed tanguyvda closed 1 month ago

tanguyvda commented 1 month ago

Description

if max_all_queues_age is reached while there was no events ready to be sent by the stream connector. Then it will trigger the flush_payload method with an empty payload (which is normal). What is not normal is that since I've implemented the pcall mecanism it will return false (nil to be more precise) instead of true in such case.

The return code must be true because when we don't have any payload to send, we need to tell our broker that every event that it has sent to the stream connector should be dropped and that it needs to start sending us the next events.

Type of change