machine: dont allow usb id request to block initialization

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2024-01-24 14:51:13 -05:00
parent 6ec37fdacc
commit 71517b255d
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 3 additions and 1 deletions

View File

@ -284,7 +284,8 @@ class Machine:
pass
async def component_init(self) -> None:
await self.update_usb_ids()
eventloop = self.server.get_event_loop()
eventloop.create_task(self.update_usb_ids())
await self.validator.validation_init()
await self.sys_provider.initialize()
if not self.inside_container:
@ -849,6 +850,7 @@ class Machine:
headers["If-None-Match"] = etag
if last_modified is not None and usb_ids_path.is_file():
headers["If-Modified-Since"] = last_modified
logging.info("Fetching latest usb.ids file...")
resp = await client.get(
USB_IDS_URL, headers, enable_cache=False
)