file_manager: attempt to start gcode uploads prior to queueing
Only attempt to queue the upload if the job failed to start. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
f09c313c5b
commit
784b8b9b18
|
@ -524,12 +524,7 @@ class FileManager:
|
||||||
started: bool = False
|
started: bool = False
|
||||||
queued: bool = False
|
queued: bool = False
|
||||||
if upload_info['start_print']:
|
if upload_info['start_print']:
|
||||||
if self.queue_gcodes:
|
if can_start:
|
||||||
job_queue: JobQueue = self.server.lookup_component('job_queue')
|
|
||||||
started = await job_queue.queue_job(
|
|
||||||
upload_info['filename'], check_exists=False)
|
|
||||||
queued = not started
|
|
||||||
elif can_start:
|
|
||||||
kapis: APIComp = self.server.lookup_component('klippy_apis')
|
kapis: APIComp = self.server.lookup_component('klippy_apis')
|
||||||
try:
|
try:
|
||||||
await kapis.start_print(upload_info['filename'])
|
await kapis.start_print(upload_info['filename'])
|
||||||
|
@ -538,6 +533,12 @@ class FileManager:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
started = True
|
started = True
|
||||||
|
if self.queue_gcodes and not started:
|
||||||
|
job_queue: JobQueue = self.server.lookup_component('job_queue')
|
||||||
|
started = await job_queue.queue_job(
|
||||||
|
upload_info['filename'], check_exists=False)
|
||||||
|
queued = not started
|
||||||
|
|
||||||
await self.notify_sync_lock.wait(300.)
|
await self.notify_sync_lock.wait(300.)
|
||||||
self.notify_sync_lock = None
|
self.notify_sync_lock = None
|
||||||
if queued:
|
if queued:
|
||||||
|
|
Loading…
Reference in New Issue