Skip to content

Commit

Permalink
fix: improve the check for not having metadata (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 authored Oct 1, 2024
1 parent d249263 commit 5c51ef3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions horde/classes/base/waiting_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,8 @@ def is_completed(self):
.filter(
procgen_class.wp_id == self.id,
procgen_class.fake.is_(False),
or_(
procgen_class.faulted.is_(False),
procgen_class.generation.is_(None),
),
procgen_class.faulted.is_(False),
procgen_class.generation.is_(None),
)
.count()
)
Expand Down
2 changes: 1 addition & 1 deletion horde/classes/stable/processing_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def log_aborted_generation(self):
def set_generation(self, generation, things_per_sec, **kwargs):
state = kwargs.get("state", "ok")
censored = False
gen_metadata = kwargs.get("gen_metadata") or []
gen_metadata = kwargs.get("gen_metadata") if kwargs.get("gen_metadata") is not None else []
for metadata in gen_metadata:
if metadata.get("type") != "censorship":
# this metadata isnt about censorship
Expand Down

0 comments on commit 5c51ef3

Please sign in to comment.