Closed tperale closed 3 years ago
On signal exit the database entry for each printer are set as "unavailable".
def signal_handler(signal, frame):
PrinterTable.query.update(dict(hidden=True, available=False))
db.session.commit()
exit()
Ideally it would be better to directly call methods of Printer
object but they are not directly accessible using threads. A future improvement could be to implement a communication mechanism that would allow call from the main process to children.
Clearing the printer table allow
huron
to know which printer is available on the "printer" page.