Should flush the connection before exiting

This commit is contained in:
Fabio Manganiello 2017-11-29 03:18:01 +01:00
parent 83cbbb26ac
commit 9790541362
2 changed files with 2 additions and 1 deletions

View File

@ -37,6 +37,7 @@ class KafkaBackend(Backend):
self._init_producer()
self.producer.send(self.topic, msg)
self.producer.flush()
def run(self):
self.consumer = KafkaConsumer(self.topic, bootstrap_servers=self.server)

View File

@ -84,7 +84,7 @@ def main():
backend = get_backend(config)
if isinstance(backend, Pushbullet):
send_pb_message(backend, config['backend.pushbullet']['device'], msg)
elif isinstance(backend, Pushbullet):
elif isinstance(backend, KafkaBackend):
send_kafka_message(backend, msg)