diff --git a/aprsd/stats/app.py b/aprsd/stats/app.py index 890bf02..1308510 100644 --- a/aprsd/stats/app.py +++ b/aprsd/stats/app.py @@ -14,6 +14,7 @@ class APRSDStats: """The AppStats class is used to collect stats from the application.""" _instance = None + start_time = None def __new__(cls, *args, **kwargs): """Have to override the new method to make this a singleton @@ -22,11 +23,9 @@ class APRSDStats: """ if not cls._instance: cls._instance = super().__new__(cls) + cls._instance.start_time = datetime.datetime.now() return cls._instance - def __init__(self): - self.start_time = datetime.datetime.now() - def uptime(self): return datetime.datetime.now() - self.start_time