J-Lindvig / Fuelprices_DK

Scraping of 5 types of fuel :fuelpump: from 8 different fuelcompanies in Denmark :denmark:.
GNU General Public License v3.0
20 stars 11 forks source link

Detected blocking call to sleep inside the event loop #12

Closed TripelJ closed 1 year ago

TripelJ commented 1 year ago

Hi There,

Thanks for the integration. :)

Wanted to let you know with the new release of HA 2022.12 I noticed in the logs that the integrations complains and it tells me to inform you about it.

Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue to the custom integration author for fuelprices_dk doing blocking calls at custom_components/fuelprices_dk/sensor.py, line 36: time.sleep(3)

now it's reported :)

Best regards.

J-Lindvig commented 1 year ago

Thank you, I will try to find another method./Jacob 21. dec. 2022 10.05 skrev TripelJ @.***>: Hi There, Thanks for the integration. :) Wanted to let you know with the new release of HA 2022.12 I noticed in the logs that the integrations complains and it tells me to inform you about it. Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue to the custom integration author for fuelprices_dk doing blocking calls at custom_components/fuelprices_dk/sensor.py, line 36: time.sleep(3) now it's reported :) Best regards.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

mm98 commented 1 year ago

Hi,

I've made some tests over the last two weeks. Removed the blocking calls and switched to asyncio, which supports non-blocking await asyncio.sleep(3).

Pull request https://github.com/J-Lindvig/Fuelprices_DK/pull/13

J-Lindvig commented 1 year ago

Great, thnak you sp much for your contribution. Changing the code as we "speak" - update will follow soon.

J-Lindvig commented 1 year ago

Added the new timeout. And fixed a new error since Circle K had changed it site + added charger from Circle K.