shutdown services properly
This commit is contained in:
parent
13f27a76ff
commit
a24cb3e04a
@ -60,3 +60,4 @@ if __name__ == "__main__":
|
|||||||
main()
|
main()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
WebSocketConnection.closeAll()
|
WebSocketConnection.closeAll()
|
||||||
|
Services.stop()
|
||||||
|
@ -369,12 +369,19 @@ class AprsHandler(object):
|
|||||||
|
|
||||||
|
|
||||||
class Services(object):
|
class Services(object):
|
||||||
|
handlers = []
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def start():
|
def start():
|
||||||
if not PropertyManager.getSharedInstance()["services_enabled"]:
|
if not PropertyManager.getSharedInstance()["services_enabled"]:
|
||||||
return
|
return
|
||||||
for source in SdrService.getSources().values():
|
for source in SdrService.getSources().values():
|
||||||
ServiceHandler(source)
|
Services.handlers.append(ServiceHandler(source))
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def stop():
|
||||||
|
for handler in Services.handlers:
|
||||||
|
handler.stopServices()
|
||||||
|
Services.handlers = []
|
||||||
|
|
||||||
|
|
||||||
class Service(object):
|
class Service(object):
|
||||||
|
Loading…
Reference in New Issue
Block a user