refactor(tcp): added in a destory function to make sure we always disconnect from the tcp device

This commit is contained in:
2025-04-24 21:25:31 -05:00
parent ead63d4b41
commit 1b90129516
4 changed files with 59 additions and 2 deletions

View File

@@ -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: `${