Reduce logging and network activity during print job upload

This commit is contained in:
ChrisTerBeke 2019-09-04 18:54:53 +02:00
parent bb11c695e2
commit 4364d94423
2 changed files with 0 additions and 5 deletions

View file

@ -122,9 +122,6 @@ class LocalClusterOutputDevice(UltimakerNetworkedPrinterOutputDevice):
self.writeStarted.emit(self) self.writeStarted.emit(self)
# Make sure the printer is aware of all new materials as the new print job might contain one.
self.sendMaterialProfiles()
# Export the scene to the correct file type. # Export the scene to the correct file type.
job = ExportFileJob(file_handler=file_handler, nodes=nodes, firmware_version=self.firmwareVersion) job = ExportFileJob(file_handler=file_handler, nodes=nodes, firmware_version=self.firmwareVersion)
job.finished.connect(self._onPrintJobCreated) job.finished.connect(self._onPrintJobCreated)

View file

@ -104,7 +104,6 @@ class SendMaterialJob(Job):
parts.append(self.device.createFormPart("name=\"signature_file\"; filename=\"{file_name}\"" parts.append(self.device.createFormPart("name=\"signature_file\"; filename=\"{file_name}\""
.format(file_name = signature_file_name), f.read())) .format(file_name = signature_file_name), f.read()))
Logger.log("d", "Syncing material %s with cluster.", material_id)
# FIXME: move form posting to API client # FIXME: move form posting to API client
self.device.postFormWithParts(target = "/cluster-api/v1/materials/", parts = parts, self.device.postFormWithParts(target = "/cluster-api/v1/materials/", parts = parts,
on_finished = self._sendingFinished) on_finished = self._sendingFinished)
@ -117,7 +116,6 @@ class SendMaterialJob(Job):
body = reply.readAll().data().decode('utf8') body = reply.readAll().data().decode('utf8')
if "not added" in body: if "not added" in body:
# For some reason the cluster returns a 200 sometimes even when syncing failed. # For some reason the cluster returns a 200 sometimes even when syncing failed.
Logger.log("w", "Error while syncing material: %s", body)
return return
# Inform the user that materials have been synced. This message only shows itself when not already visible. # Inform the user that materials have been synced. This message only shows itself when not already visible.
# Because of the guards above it is not shown when syncing failed (which is not always an actual problem). # Because of the guards above it is not shown when syncing failed (which is not always an actual problem).