gcobb321 / icloud3

iCloud3 v3 - iCloud3 is an advanced iDevice tracker that uses Apple iCloud account and HA Companion App data for presence detection and location based automations.
MIT License
498 stars 52 forks source link

I/O in event loop #314

Closed balloob closed 3 months ago

balloob commented 3 months ago

Was looking at logs from a bug report in Home Assistant and stumbled over your custom component. Was looking at the source and noticed that you call restore_state.load_storage_icloud3_restore_state_file() inside async_setup_entry. This method needs to be run in the executor to avoid doing I/O in the event loop, causing all of Home Assistant to stall.

gcobb321 commented 3 months ago

Thank you for your advice. This change has been included in the version of iCloud3 v3.0.1 that will be posted to the iCloud3 Development GitHub repository this week and the general release GitHub repository a short time later.