git_deploy: fix initialization regression

New repos have not yet saved the valid state, so it is necessary to
provide a default value when attempting to access the "is_valid"
field.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2024-02-24 05:40:33 -05:00
parent 119f579a44
commit 90e13c07f7
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ class GitDeploy(AppDeploy):
async def initialize(self) -> Dict[str, Any]:
storage = await super().initialize()
await self.repo.restore_state(storage)
self._is_valid = storage["is_valid"]
self._is_valid = storage.get("is_valid", self.repo.is_valid())
if not self.needs_refresh():
self.repo.log_repo_info()
return storage