Should flush the connection before exiting
This commit is contained in:
parent
83cbbb26ac
commit
9790541362
2 changed files with 2 additions and 1 deletions
|
@ -37,6 +37,7 @@ class KafkaBackend(Backend):
|
||||||
|
|
||||||
self._init_producer()
|
self._init_producer()
|
||||||
self.producer.send(self.topic, msg)
|
self.producer.send(self.topic, msg)
|
||||||
|
self.producer.flush()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.consumer = KafkaConsumer(self.topic, bootstrap_servers=self.server)
|
self.consumer = KafkaConsumer(self.topic, bootstrap_servers=self.server)
|
||||||
|
|
|
@ -84,7 +84,7 @@ def main():
|
||||||
backend = get_backend(config)
|
backend = get_backend(config)
|
||||||
if isinstance(backend, Pushbullet):
|
if isinstance(backend, Pushbullet):
|
||||||
send_pb_message(backend, config['backend.pushbullet']['device'], msg)
|
send_pb_message(backend, config['backend.pushbullet']['device'], msg)
|
||||||
elif isinstance(backend, Pushbullet):
|
elif isinstance(backend, KafkaBackend):
|
||||||
send_kafka_message(backend, msg)
|
send_kafka_message(backend, msg)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue