From a94e76a7ca71965621a984014be0e5c40446a49c Mon Sep 17 00:00:00 2001 From: Arnaud SJongers Date: Mon, 4 Jun 2018 17:20:20 +0200 Subject: [PATCH] only flush once --- utils/watchers.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/utils/watchers.js b/utils/watchers.js index 2ca1f46..a425b77 100644 --- a/utils/watchers.js +++ b/utils/watchers.js @@ -207,7 +207,6 @@ async function watchDataSubjects () { dataSubjectId, Date.now() ) - producer.flush() } catch (error) { console.error("An error occurred when trying to send message to Kafka topic [%s]: %s", changeLogsTopic, error) console.error(error) @@ -223,11 +222,11 @@ async function watchDataSubjects () { dataSubjectId, // To ensure we only keep the latest set of policies Date.now() ) - producer.flush() } catch (error) { console.error("An error occurred when trying to send message to Kafka topic [%s]: %s", fullPolicyTopic, error) console.error(error) } + producer.flush() }, () => { return conn.close() })