mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 08:56:30 +03:00
fix runtime
This commit is contained in:
@@ -39,6 +39,7 @@ use futures_lite::StreamExt;
|
|||||||
use iroh::bytes::get::{fsm, Stats};
|
use iroh::bytes::get::{fsm, Stats};
|
||||||
use iroh::bytes::protocol::{AnyGetRequest, GetRequest, RequestToken};
|
use iroh::bytes::protocol::{AnyGetRequest, GetRequest, RequestToken};
|
||||||
use iroh::bytes::provider::Event as ProviderEvent;
|
use iroh::bytes::provider::Event as ProviderEvent;
|
||||||
|
use iroh::bytes::util::runtime;
|
||||||
use iroh::collection::Collection;
|
use iroh::collection::Collection;
|
||||||
use iroh::database::flat::DataSource;
|
use iroh::database::flat::DataSource;
|
||||||
use iroh::dial::Ticket;
|
use iroh::dial::Ticket;
|
||||||
@@ -189,9 +190,11 @@ impl BackupProvider {
|
|||||||
let (db, hash) = iroh::database::flat::create_collection(files).await?;
|
let (db, hash) = iroh::database::flat::create_collection(files).await?;
|
||||||
context.emit_event(SendProgress::CollectionCreated.into());
|
context.emit_event(SendProgress::CollectionCreated.into());
|
||||||
let auth_token_handler = StaticTokenAuthHandler::new(Some(token.clone()));
|
let auth_token_handler = StaticTokenAuthHandler::new(Some(token.clone()));
|
||||||
|
let rt = runtime::Handle::from_currrent(1)?;
|
||||||
let provider = Node::builder(db)
|
let provider = Node::builder(db)
|
||||||
.bind_addr((Ipv4Addr::UNSPECIFIED, 0).into())
|
.bind_addr((Ipv4Addr::UNSPECIFIED, 0).into())
|
||||||
.custom_auth_handler(Arc::new(auth_token_handler))
|
.custom_auth_handler(Arc::new(auth_token_handler))
|
||||||
|
.runtime(&rt)
|
||||||
.spawn()
|
.spawn()
|
||||||
.await?;
|
.await?;
|
||||||
context.emit_event(SendProgress::ProviderListening.into());
|
context.emit_event(SendProgress::ProviderListening.into());
|
||||||
|
|||||||
Reference in New Issue
Block a user