From 0acc20f498feef92e788e7228290a8d9f8b0b8d4 Mon Sep 17 00:00:00 2001 From: Simon Voordouw Date: Tue, 27 Jun 2017 17:42:19 +0200 Subject: [PATCH] stop print-fetch before stopping print --- src/rest/api/api_printer.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rest/api/api_printer.lua b/src/rest/api/api_printer.lua index ad6443e..d29df38 100644 --- a/src/rest/api/api_printer.lua +++ b/src/rest/api/api_printer.lua @@ -166,13 +166,14 @@ function M.stop_POST(request, response) local printer,msg = printerUtils.createPrinterOrFail(argId, response) if not printer or not printer:hasSocket() then return end + io.popen("killall print-fetch") + io.popen("rm /tmp/current-print /tmp/startcode /tmp/endcode") + if(argGcode == nil) then argGcode = "" end local rv,msg = printer:stopPrint(argGcode) - io.popen("killall print-fetch") - io.popen("rm /tmp/current-print /tmp/startcode /tmp/endcode") response:addData('id', argId)