feat: background worker runs in multi-threaded runtime

This commit is contained in:
əlemi 2022-11-05 18:35:10 +01:00
parent ddf237861c
commit 372e17caad
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -93,7 +93,7 @@ fn main() {
setup_tracing(None); setup_tracing(None);
let worker = std::thread::spawn(move || { let worker = std::thread::spawn(move || {
tokio::runtime::Builder::new_current_thread() tokio::runtime::Builder::new_multi_thread()
.enable_all() .enable_all()
.build() .build()
.unwrap() .unwrap()
@ -114,7 +114,7 @@ fn main() {
jobs.push( jobs.push(
tokio::spawn( tokio::spawn(
surveyor_loop( surveyor_loop(
db.clone(), db,
args.interval as i64, args.interval as i64,
args.cache_time as i64, args.cache_time as i64,
run_rx.clone(), run_rx.clone(),