Bugfix: Do not run gcode analyzer when a print is ongoing
Evaluate active flag on gcode analyzer AFTER fetching an item from the work queue, otherwise it will always start working once it finds something if the active flag was true once but then switched to false while the queue was still empty. Thanks to @Salandora for spotting this.
Fixes #357
(manually cherry-picked from 592f3dc)
This commit is contained in:
parent
b282a18f6b
commit
0747336c0f
1 changed files with 2 additions and 2 deletions
|
|
@ -358,8 +358,6 @@ class MetadataAnalyzer:
|
|||
def _work(self):
|
||||
aborted = None
|
||||
while True:
|
||||
self._active.wait()
|
||||
|
||||
if aborted is not None:
|
||||
filename = aborted
|
||||
aborted = None
|
||||
|
|
@ -368,6 +366,8 @@ class MetadataAnalyzer:
|
|||
(priority, filename) = self._queue.get()
|
||||
self._logger.debug("Processing file %s from queue (priority %d)" % (filename, priority))
|
||||
|
||||
self._active.wait()
|
||||
|
||||
try:
|
||||
self._analyzeGcode(filename)
|
||||
self._queue.task_done()
|
||||
|
|
|
|||
Loading…
Reference in a new issue