MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / shutdown

Function shutdown

src/Debug/DebugHook.py:14–26  ·  view source on GitHub ↗
(reason="Unknown")

Source from the content-addressed store, hash-verified

12last_error = None
13
14def shutdown(reason="Unknown"):
15 logging.info("Shutting down (reason: %s)..." % reason)
16 import main
17 if "file_server" in dir(main):
18 try:
19 gevent.spawn(main.file_server.stop)
20 if "ui_server" in dir(main):
21 gevent.spawn(main.ui_server.stop)
22 except Exception as err:
23 print("Proper shutdown error: %s" % err)
24 sys.exit(0)
25 else:
26 sys.exit(0)
27
28# Store last error, ignore notify, allow manual error logging
29def handleError(*args, **kwargs):

Callers 3

handleErrorFunction · 0.85
handleErrorNotifyFunction · 0.85
DebugHook.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected