Skip to content

Commit

Permalink
[service-utils] fix: build error on kafka disconnect()
Browse files Browse the repository at this point in the history
  • Loading branch information
arcoraven committed Mar 1, 2025
1 parent 25b149d commit efd6106
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/service-utils/src/node/kafka.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,9 @@ export class KafkaProducer {
* Useful when shutting down the service to flush in-flight events.
*/
async disconnect() {
if (this.isConnected) {
try {
await this.producer.flush();
await this.producer.disconnect();
} catch {}
this.isConnected = false;
}
try {
await this.producer.flush();
await this.producer.disconnect();
} catch {}
}
}

0 comments on commit efd6106

Please sign in to comment.