Skip to content

Commit efd6106

Browse files
committed
[service-utils] fix: build error on kafka disconnect()
1 parent 25b149d commit efd6106

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

packages/service-utils/src/node/kafka.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,9 @@ export class KafkaProducer {
105105
* Useful when shutting down the service to flush in-flight events.
106106
*/
107107
async disconnect() {
108-
if (this.isConnected) {
109-
try {
110-
await this.producer.flush();
111-
await this.producer.disconnect();
112-
} catch {}
113-
this.isConnected = false;
114-
}
108+
try {
109+
await this.producer.flush();
110+
await this.producer.disconnect();
111+
} catch {}
115112
}
116113
}

0 commit comments

Comments
 (0)