mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 16:59:01 +08:00
Improve documentation for lazy-loading background task
In particular the thread switching sleep was a bit mysterious. Contributes to issue CURA_6793.
This commit is contained in:
parent
f69360fb14
commit
5b70d409ed
@ -146,7 +146,10 @@ class ContainerTree:
|
|||||||
#
|
#
|
||||||
# The ``JobQueue`` will schedule this on a different thread.
|
# The ``JobQueue`` will schedule this on a different thread.
|
||||||
def run(self) -> None:
|
def run(self) -> None:
|
||||||
for stack in self.container_stacks:
|
for stack in self.container_stacks: # Load all currently-added containers.
|
||||||
|
# Allow a thread switch after every container.
|
||||||
|
# Experimentally, sleep(0) didn't allow switching. sleep(0.1) or sleep(0.2) neither.
|
||||||
|
# We're in no hurry though. Half a second is fine.
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
if not isinstance(stack, GlobalStack):
|
if not isinstance(stack, GlobalStack):
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user