mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 19:46:50 +00:00
cleanup around runstate exit
This commit is contained in:
parent
3c4e5f588c
commit
7297b5d386
@ -83,7 +83,7 @@ pub fn start() {
|
||||
task::spawn(async {
|
||||
let mut read_runstate = GLOBALS.read_runstate.clone();
|
||||
read_runstate.mark_unchanged();
|
||||
if !read_runstate.borrow().going_online() {
|
||||
if read_runstate.borrow().going_offline() {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ pub fn start() {
|
||||
_ = &mut sleep => {
|
||||
sleep.as_mut().reset(Instant::now() + Duration::from_secs(15));
|
||||
},
|
||||
_ = read_runstate.wait_for(|runstate| !runstate.going_online()) => break,
|
||||
_ = read_runstate.wait_for(|runstate| runstate.going_offline()) => break,
|
||||
}
|
||||
|
||||
let pending = match Pending::compute_pending() {
|
||||
|
@ -78,7 +78,7 @@ impl People {
|
||||
task::spawn(async {
|
||||
let mut read_runstate = GLOBALS.read_runstate.clone();
|
||||
read_runstate.mark_unchanged();
|
||||
if !read_runstate.borrow().going_online() {
|
||||
if read_runstate.borrow().going_offline() {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ impl People {
|
||||
GLOBALS.storage.read_setting_fetcher_metadata_looptime_ms();
|
||||
sleep.as_mut().reset(Instant::now() + Duration::from_millis(fetch_metadata_looptime_ms));
|
||||
},
|
||||
_ = read_runstate.wait_for(|runstate| !runstate.going_online()) => break,
|
||||
_ = read_runstate.wait_for(|runstate| runstate.going_offline()) => break,
|
||||
}
|
||||
|
||||
// We fetch needed metadata
|
||||
|
Loading…
Reference in New Issue
Block a user