Podcastindex-org/helipad

Use `tokio::time::sleep` instead of `std::thread::sleep`?

Closed this issue · 1 comments

The std::thread::sleep call in the LND poller seems to cause the HTTP server to sleep as well (at least in my copy of Helipad). This causes the web interface to feel sluggish as the browser is waiting for the HTTP server to stop sleeping.

Changing the following line:

std::thread::sleep(std::time::Duration::from_millis(9000));

to use tokio::time::sleep seems to fix the issue:

tokio::time::sleep(tokio::time::Duration::from_millis(9000)).await;

Good catch! I’ll make that change. I’ve been wondering why that’s happening.