improve shutdown handling

This commit is contained in:
Jakob Ketterl
2019-05-12 18:10:24 +02:00
parent 17a362fe7a
commit a85a6c694c
6 changed files with 58 additions and 31 deletions

View File

@ -2,7 +2,7 @@ from http.server import HTTPServer
from owrx.http import RequestHandler
from owrx.config import PropertyManager
from owrx.feature import FeatureDetector
from owrx.source import SdrService
from owrx.source import SdrService, ClientRegistry
from socketserver import ThreadingMixIn
from owrx.sdrhu import SdrHuUpdater
@ -45,4 +45,8 @@ Author contact info: Andras Retzler, HA7ILM <randras@sdr.hu>
if __name__ == "__main__":
main()
try:
main()
except KeyboardInterrupt:
for c in ClientRegistry.getSharedInstance().clients:
c.close()