streamline batch insertions

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-11-16 23:13:27 +00:00
commit 90106c4c33
5 changed files with 63 additions and 49 deletions

View file

@ -118,7 +118,7 @@ impl Service {
// Insert any pdus we found
if !new_events.is_empty() {
self.db.mark_as_active(&new_events);
self.db.mark_as_active(new_events.iter());
let new_events_vec = new_events.into_iter().map(|(_, event)| event).collect();
futures.push(self.send_events(dest.clone(), new_events_vec).boxed());
@ -213,7 +213,7 @@ impl Service {
// Compose the next transaction
let _cork = self.db.db.cork();
if !new_events.is_empty() {
self.db.mark_as_active(&new_events);
self.db.mark_as_active(new_events.iter());
for (_, e) in new_events {
events.push(e);
}