Function holochain::test_utils::force_publish_dht_ops
source · pub async fn force_publish_dht_ops(
vault: &DbWrite<DbKindAuthored>,
publish_trigger: &mut TriggerSender
) -> DatabaseResult<()>
Expand description
Force all dht ops without enough validation receipts to be published.
Examples found in repository?
src/sweettest/sweet_conductor.rs (line 463)
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469
pub async fn force_all_publish_dht_ops(&self) {
use futures::stream::StreamExt;
if let Some(handle) = self.handle.as_ref() {
let iter = handle.list_cell_ids(None).into_iter().map(|id| async {
let id = id;
let db = self.get_authored_db(id.dna_hash()).unwrap();
let trigger = self.get_cell_triggers(&id).unwrap();
(db, trigger)
});
futures::stream::iter(iter)
.then(|f| f)
.for_each(|(db, mut triggers)| async move {
// The line below was added when migrating to rust edition 2021, per
// https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html#migration
let _ = &triggers;
crate::test_utils::force_publish_dht_ops(&db, &mut triggers.publish_dht_ops)
.await
.unwrap();
})
.await;
}
}