diff --git a/vnpy/trader/engine.py b/vnpy/trader/engine.py index af136dab..2d4a98e0 100644 --- a/vnpy/trader/engine.py +++ b/vnpy/trader/engine.py @@ -24,7 +24,7 @@ from .event import ( from .gateway import BaseGateway from .object import CancelRequest, LogData, OrderRequest, SubscribeRequest from .setting import SETTINGS -from .utility import Singleton, get_folder_path +from .utility import get_folder_path class MainEngine: @@ -197,7 +197,7 @@ class BaseEngine(ABC): pass -class LogEngine(BaseEngine, metaclass=Singleton): +class LogEngine(BaseEngine): """ Processes log event and output with logging module. """ diff --git a/vnpy/trader/utility.py b/vnpy/trader/utility.py index 6f023259..1f40aa77 100644 --- a/vnpy/trader/utility.py +++ b/vnpy/trader/utility.py @@ -12,25 +12,6 @@ import talib from .object import BarData, TickData -class Singleton(type): - """ - Singleton metaclass, - - usage: - class A(metaclass=Singleton): - ... - """ - _instances = {} - - def __call__(cls, *args, **kwargs): - """""" - if cls not in cls._instances: - cls._instances[cls] = super(Singleton, cls).__call__( - *args, **kwargs - ) - return cls._instances[cls] - - def _get_trader_dir(temp_name: str): """ Get path where trader is running in.