mirror of
https://github.com/romanz/electrs.git
synced 2025-02-24 23:08:39 +01:00
Respond to SIGINT during indexing phase
This commit is contained in:
parent
f8a577b396
commit
67bf98f238
1 changed files with 1 additions and 2 deletions
|
@ -16,8 +16,6 @@ use electrs::{app::{App, Waiter},
|
||||||
|
|
||||||
fn run_server(config: &Config) -> Result<()> {
|
fn run_server(config: &Config) -> Result<()> {
|
||||||
let daemon = Daemon::new(config.network_type)?;
|
let daemon = Daemon::new(config.network_type)?;
|
||||||
|
|
||||||
let signal = Waiter::new(Duration::from_secs(5));
|
|
||||||
let store = DBStore::open(
|
let store = DBStore::open(
|
||||||
&config.db_path,
|
&config.db_path,
|
||||||
StoreOptions {
|
StoreOptions {
|
||||||
|
@ -35,6 +33,7 @@ fn run_server(config: &Config) -> Result<()> {
|
||||||
|
|
||||||
let query = Query::new(app.clone());
|
let query = Query::new(app.clone());
|
||||||
let rpc = RPC::start(config.rpc_addr, query.clone());
|
let rpc = RPC::start(config.rpc_addr, query.clone());
|
||||||
|
let signal = Waiter::new(Duration::from_secs(5));
|
||||||
while let None = signal.wait() {
|
while let None = signal.wait() {
|
||||||
query.update_mempool()?;
|
query.update_mempool()?;
|
||||||
if tip != app.daemon().getbestblockhash()? {
|
if tip != app.daemon().getbestblockhash()? {
|
||||||
|
|
Loading…
Add table
Reference in a new issue