mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Fix turbojpeg init doing blocking I/O in the event loop (#117971)
* Fix turbojpeg init doing blocking I/O in the event loop fixes ``` Detected blocking call to open inside the event loop by integration camera at homeassistant/components/camera/img_util.py, line 100: TurboJPEGSingleton.__instance = TurboJPEG() (offender: /usr/local/lib/python3.12/ctypes/util.py, line 276: with open(filepath, rb) as fh:), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+camera%22 ``` * Update homeassistant/components/camera/img_util.py * Fix turbojpeg init doing blocking I/O in the event loop fixes ``` Detected blocking call to open inside the event loop by integration camera at homeassistant/components/camera/img_util.py, line 100: TurboJPEGSingleton.__instance = TurboJPEG() (offender: /usr/local/lib/python3.12/ctypes/util.py, line 276: with open(filepath, rb) as fh:), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+camera%22 ``` * already suppressed and logged
This commit is contained in:
parent
6b2ddcca5e
commit
09e7156d2d
@ -103,3 +103,9 @@ class TurboJPEGSingleton:
|
||||
"Error loading libturbojpeg; Camera snapshot performance will be sub-optimal"
|
||||
)
|
||||
TurboJPEGSingleton.__instance = False
|
||||
|
||||
|
||||
# TurboJPEG loads libraries that do blocking I/O.
|
||||
# Initialize TurboJPEGSingleton in the executor to avoid
|
||||
# blocking the event loop.
|
||||
TurboJPEGSingleton.instance()
|
||||
|
Loading…
x
Reference in New Issue
Block a user