MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / restartServer

Method restartServer

src/astroprint/software.py:601–623  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

599 self._updater = None
600
601 def restartServer(self):
602 if platformStr == "linux" or platformStr == "linux2":
603 actions = self._settings.get(["system", "actions"])
604 for a in actions:
605 if a['action'] == 'reboot':
606 #Call to Popen will start the restart command but return inmediately before it completes
607 threading.Timer(1.0, subprocess.Popen, [a['command'].split(' ')]).start()
608 self._logger.info('Restart command scheduled')
609
610 from astroprint.printer.manager import printerManager
611 from astroprint.camera import cameraManager
612 from astroprint.network.manager import networkManagerShutdown
613
614 #let's be nice about shutthing things down
615 printerManager().disconnect()
616 cameraManager().close_camera()
617 networkManagerShutdown()
618
619 return True
620
621 return False
622
623 return True
624
625 def sendLogs(self, ticketNo=None, message=None):
626 import zipfile

Callers

nothing calls this directly

Calls 7

printerManagerFunction · 0.90
cameraManagerFunction · 0.90
networkManagerShutdownFunction · 0.90
close_cameraMethod · 0.80
getMethod · 0.45
startMethod · 0.45
disconnectMethod · 0.45

Tested by

no test coverage detected