From 5a93456dcdf64316d411c526059444afe45c8b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Sun, 17 May 2020 21:00:08 -0400 Subject: [PATCH] WIP --- bazarr/main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bazarr/main.py b/bazarr/main.py index 4f464abab..5f8a6d3c1 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -481,6 +481,15 @@ class Server: port=int(args.port) if args.port else int(settings.general.port), threads=24) + # Make sure that server class instance isn't getting instantiated again but reused instead. + _instance = None + + def __new__(cls, *args, **kwargs): + if not cls._instance: + cls._instance = super(Server, cls).__new__( + cls, *args, **kwargs) + return cls._instance + @classmethod def start(cls): try: