From 7b5d8de93f642948609da2ad01429d0434c321fd Mon Sep 17 00:00:00 2001 From: Gregor Reitzenstein Date: Tue, 15 Dec 2020 13:04:03 +0100 Subject: [PATCH] Pass network --- src/main.rs | 2 +- src/server.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0bb1961..5c279b2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -176,7 +176,7 @@ fn maybe(matches: clap::ArgMatches, log: Arc) -> Result<(), Error> { // TODO: Spawn api connections on their own (non-main) thread, use the main thread to // handle signals (a cli if stdin is not closed?) and make it stop and clean up all threads // when bffh should exit - server::serve_api_connections(log.clone(), config, db) + server::serve_api_connections(log.clone(), config, db, network) // Signal is dropped here, stopping all executor threads as well. } } diff --git a/src/server.rs b/src/server.rs index fede905..4828733 100644 --- a/src/server.rs +++ b/src/server.rs @@ -27,7 +27,9 @@ use std::sync::Arc; use crate::db::Databases; /// Handle all API connections and run the RPC tasks spawned from that on the local thread. -pub fn serve_api_connections(log: Arc, config: Settings, db: Databases) -> Result<(), Error> { +pub fn serve_api_connections(log: Arc, config: Settings, db: Databases, nw: Network) + -> Result<(), Error> +{ let signal = Box::pin(async { let (tx, mut rx) = UnixStream::pair()?; // Initialize signal handler.