Skip to content

Commit

Permalink
fix: acquire locks in shutdown loop
Browse files Browse the repository at this point in the history
  • Loading branch information
tazlin committed Oct 5, 2023
1 parent 7b74ae9 commit cd75a67
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions horde_worker_regen/process_management/process_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ async def api_job_pop(self) -> None:
job_pop_request = ImageGenerateJobPopRequest(
apikey=self.bridge_data.api_key,
name=self.bridge_data.dreamer_worker_name,
bridge_agent="AI Horde Worker reGen:2:https://github.com/Haidra-Org/",
bridge_agent="AI Horde Worker reGen:2:https://github.com/Haidra-Org/horde-worker-reGen/",
bridge_version=2,
models=self.bridge_data.image_models_to_load,
nsfw=self.bridge_data.nsfw,
Expand Down Expand Up @@ -1663,7 +1663,8 @@ async def _process_control_loop(self) -> None:

while len(self.job_deque) > 0:
await asyncio.sleep(0.2)
self.receive_and_handle_process_messages()
async with self._job_deque_lock, self._jobs_safety_check_lock, self._completed_jobs_lock:
self.receive_and_handle_process_messages()
await asyncio.sleep(0.2)

self.end_safety_processes()
Expand Down

0 comments on commit cd75a67

Please sign in to comment.