refactor(tcp): added in a destory function to make sure we always disconnect from the tcp device
This commit is contained in:
@@ -45,6 +45,20 @@ export const unPausePrinter = async (printerData: any) => {
|
||||
});
|
||||
});
|
||||
|
||||
pause.on("end", () => {
|
||||
setTimeout(() => {
|
||||
if (!pause.destroyed) {
|
||||
createLog(
|
||||
"info",
|
||||
"printerState",
|
||||
"ocp",
|
||||
`${printerData.name}: was force closed, in unpause menu`
|
||||
);
|
||||
pause.destroy();
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
resolve({
|
||||
success: true,
|
||||
message: `${
|
||||
|
||||
Reference in New Issue
Block a user