Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion backend/src/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,11 @@ def aborted(self) -> bool:

@property
def paused(self) -> bool:
time.sleep(0.001)
# Python is single-threaded, so it's necessary for this thread to yield, so other threads can do some work.
# This is necessary because the thread for accepting the `/pause` endpoint would not be able to accept requests otherwise.
# This in turn would mean that `self.progress.paused` would never be set to True.
# For more information, see https://github.com/chaiNNer-org/chaiNNer/pull/2853
time.sleep(0)
return self.progress.paused

def set_progress(self, progress: float) -> None:
Expand Down