From fce6b3e44c8b42bd78d8fa3f3ce5747eb285345f Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sun, 14 Apr 2024 23:18:41 -0400 Subject: [PATCH] maybe solve race issue --- invokeai/app/services/model_install/model_install_default.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/invokeai/app/services/model_install/model_install_default.py b/invokeai/app/services/model_install/model_install_default.py index 5aa0f199fc..6a3117bcb8 100644 --- a/invokeai/app/services/model_install/model_install_default.py +++ b/invokeai/app/services/model_install/model_install_default.py @@ -754,6 +754,8 @@ class ModelInstallService(ModelInstallServiceBase): self._download_cache[download_job.source] = install_job # matches a download job to an install job install_job.download_parts.add(download_job) + # only start the jobs once install_job.download_parts is fully populated + for download_job in install_job.download_parts: self._download_queue.submit_download_job( download_job, on_start=self._download_started_callback, @@ -762,6 +764,7 @@ class ModelInstallService(ModelInstallServiceBase): on_error=self._download_error_callback, on_cancelled=self._download_cancelled_callback, ) + return install_job def _stat_size(self, path: Path) -> int: