From b0b2df5422ceb022b206317934431a3a724823c3 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 15 Sep 2019 21:10:30 +0200 Subject: [PATCH] no need for shared instances here --- openwebrx.py | 4 ++-- owrx/service.py | 11 ++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/openwebrx.py b/openwebrx.py index 9fa685b..a013349 100755 --- a/openwebrx.py +++ b/openwebrx.py @@ -7,7 +7,7 @@ from owrx.feature import FeatureDetector from owrx.source import SdrService, ClientRegistry from socketserver import ThreadingMixIn from owrx.sdrhu import SdrHuUpdater -from owrx.service import ServiceManager +from owrx.service import Services import logging @@ -48,7 +48,7 @@ Author contact info: Andras Retzler, HA7ILM updater = SdrHuUpdater() updater.start() - ServiceManager.getSharedInstance().start() + Services.start() server = ThreadedHttpServer(("0.0.0.0", pm.getPropertyValue("web_port")), RequestHandler) server.serve_forever() diff --git a/owrx/service.py b/owrx/service.py index 7517249..89e68aa 100644 --- a/owrx/service.py +++ b/owrx/service.py @@ -205,16 +205,9 @@ class AprsHandler(object): pass -class ServiceManager(object): - sharedInstance = None - +class Services(object): @staticmethod - def getSharedInstance(): - if ServiceManager.sharedInstance is None: - ServiceManager.sharedInstance = ServiceManager() - return ServiceManager.sharedInstance - - def start(self): + def start(): if not PropertyManager.getSharedInstance()["services_enabled"]: return for source in SdrService.getSources().values():