maybe solve race issue

This commit is contained in:
Lincoln Stein 2024-04-14 23:18:41 -04:00 committed by psychedelicious
parent e93f4d632d
commit fce6b3e44c

View File

@ -754,6 +754,8 @@ class ModelInstallService(ModelInstallServiceBase):
self._download_cache[download_job.source] = install_job # matches a download job to an install job self._download_cache[download_job.source] = install_job # matches a download job to an install job
install_job.download_parts.add(download_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( self._download_queue.submit_download_job(
download_job, download_job,
on_start=self._download_started_callback, on_start=self._download_started_callback,
@ -762,6 +764,7 @@ class ModelInstallService(ModelInstallServiceBase):
on_error=self._download_error_callback, on_error=self._download_error_callback,
on_cancelled=self._download_cancelled_callback, on_cancelled=self._download_cancelled_callback,
) )
return install_job return install_job
def _stat_size(self, path: Path) -> int: def _stat_size(self, path: Path) -> int: