mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-10 19:02:50 +02:00
streamline batch insertions
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
a05dc03100
commit
90106c4c33
5 changed files with 63 additions and 49 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue