Since we need to read the entire archive to extract the entire filelist
with all its meta information, we need to move this into a separate
thread.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
)
# Import filelist
- pkg._import_filelist(archive.filelist)
+ await pkg._import_filelist(archive)
# Import package data
await pkg._import_archive(archive)
# Store the path
self._set_attribute("path", path)
- def _import_filelist(self, filelist):
+ async def _import_filelist(self, archive):
log.debug("Importing filelist for %s" % self)
+ # Fetch the filelist
+ filelist = await asyncio.to_thread(lambda a: a.filelist, archive)
+
self.db.executemany("""
INSERT INTO
package_files