🐛 Fix print logging
This commit is contained in:
1 parent
caad7a3f60
commit
c27936a9db
2 files changed
+15
-13
No files matched your search
@@ -137,7 +137,7 @@ class Printjob(with_metaclass(ABCMeta, ProtocolListener, ListenerAware)):
|
||||
payload["owner"] = self._user
|
||||
elapsed = self.elapsed
|
||||
if elapsed is not None:
|
||||
payload["time"] = self.elapsed
|
||||
payload["time"] = elapsed
|
||||
|
||||
return payload
|
||||
|
||||
|
||||
@@ -1354,19 +1354,21 @@ class Printer(PrinterInterface,
|
||||
if self._job_event_handled(protocol, job, "done"):
|
||||
return
|
||||
|
||||
payload = job.event_payload()
|
||||
if payload:
|
||||
def log_print():
|
||||
self._file_manager.log_print(payload["origin"],
|
||||
payload["path"],
|
||||
time.time(),
|
||||
payload["time"],
|
||||
True,
|
||||
self._printer_profile_manager.get_current_or_default()["id"])
|
||||
if job.last_result.available:
|
||||
payload = job.event_payload()
|
||||
elapsed = job.last_result.elapsed
|
||||
if elapsed is not None:
|
||||
def log_print():
|
||||
self._file_manager.log_print(payload["origin"],
|
||||
payload["path"],
|
||||
time.time(),
|
||||
elapsed,
|
||||
True,
|
||||
self._printer_profile_manager.get_current_or_default()["id"])
|
||||
|
||||
thread = threading.Thread(target=log_print)
|
||||
thread.daemon = True
|
||||
thread.start()
|
||||
thread = threading.Thread(target=log_print)
|
||||
thread.daemon = True
|
||||
thread.start()
|
||||
|
||||
def on_protocol_job_failed(self, protocol, job, *args, **kwargs):
|
||||
if protocol != self._protocol:
|
||||
|
||||
Reference in new issue
Block a user