From 9790541362c1236a4d45ae854dab37818914feb7 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 29 Nov 2017 03:18:01 +0100 Subject: [PATCH] Should flush the connection before exiting --- runbullet/backend/kafka/__init__.py | 1 + runbullet/bin/pusher | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/runbullet/backend/kafka/__init__.py b/runbullet/backend/kafka/__init__.py index 0cfd797e..c0fabbff 100644 --- a/runbullet/backend/kafka/__init__.py +++ b/runbullet/backend/kafka/__init__.py @@ -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) diff --git a/runbullet/bin/pusher b/runbullet/bin/pusher index 0fb06bb2..2eebb3cf 100755 --- a/runbullet/bin/pusher +++ b/runbullet/bin/pusher @@ -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)