Skip to content

Commit

Permalink
Explicitly delete consumer after iterating over kv keys
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
  • Loading branch information
Jarema committed Jan 26, 2023
1 parent 16306f6 commit 250547c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions async-nats/src/jetstream/kv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,8 @@ impl Store {
})
.await?;

let consumer_name = consumer.info.name.clone();

let mut entries = History {
done: consumer.info.num_pending == 0,
subscription: consumer.messages().await?,
Expand All @@ -689,6 +691,7 @@ impl Store {
keys.insert(entry.key);
}
}
self.stream.delete_consumer(&consumer_name).await?;
Ok(keys.into_iter())
}
}
Expand Down

0 comments on commit 250547c

Please sign in to comment.