Skip to content

Commit

Permalink
fix: prevent getting jobs when generation running (#90)
Browse files Browse the repository at this point in the history
* fix: prevent getting jobs when generation running

* fix: only lock job getting
  • Loading branch information
MaikoTan committed Mar 24, 2023
1 parent 2372bc1 commit a3e67b5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions stable_horde/horde.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,14 @@ async def run(self):

if self.config.enabled:
try:
req = await HordeJob.get(
await self.get_session(),
self.config,
list(self.current_models.keys()),
)
# Require a queue lock to prevent getting jobs when
# there are generation jobs from webui.
with call_queue.queue_lock:
req = await HordeJob.get(
await self.get_session(),
self.config,
list(self.current_models.keys()),
)
if req is None:
continue

Expand Down

0 comments on commit a3e67b5

Please sign in to comment.