Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of ticker in tokio spawn is blocking async tasks #239

Open
moschopsuk opened this issue Apr 27, 2023 · 0 comments
Open

Use of ticker in tokio spawn is blocking async tasks #239

moschopsuk opened this issue Apr 27, 2023 · 0 comments

Comments

@moschopsuk
Copy link

Hello great niche repo that i have found very useful, in my own grafana setup.

I noticed that when hitting the prometheus http endpoint it was very slow to respond and seemed to be related to the ticker duration.

Doing a bit of digging it seem that tokio sleep should be used rather than using the ticker as that wont cause the the async task to block other async tasks.
https://docs.rs/tokio/latest/tokio/time/fn.sleep.html

Happy to raise a PR to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant