Skip to content

Commit 4cb0b33

Browse files
committed
Simplify callbacks to get and check timers
No need to make it complicated using async tasks?
1 parent 8aae34e commit 4cb0b33

File tree

1 file changed

+2
-12
lines changed
  • lightning-background-processor/src

1 file changed

+2
-12
lines changed

lightning-background-processor/src/lib.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -902,18 +902,8 @@ where
902902
},
903903
}
904904
},
905-
|t| sleeper(Duration::from_secs(t)),
906-
|fut: &mut SleepFuture, _| {
907-
let mut waker = dummy_waker();
908-
let mut ctx = task::Context::from_waker(&mut waker);
909-
match core::pin::Pin::new(fut).poll(&mut ctx) {
910-
task::Poll::Ready(exit) => {
911-
should_break = exit;
912-
true
913-
},
914-
task::Poll::Pending => false,
915-
}
916-
},
905+
|_| Instant::now(),
906+
|time: &Instant, dur| time.elapsed().as_secs() > dur,
917907
mobile_interruptable_platform,
918908
fetch_time,
919909
)

0 commit comments

Comments
 (0)