diff --git a/dxfeed/core/DXFeedPy.pyx b/dxfeed/core/DXFeedPy.pyx index fddb1f3..deb1d1d 100644 --- a/dxfeed/core/DXFeedPy.pyx +++ b/dxfeed/core/DXFeedPy.pyx @@ -231,7 +231,7 @@ def dxf_create_subscription(ConnectionClass cc, event_type: str, candle_time: Op candle_time = datetime.strptime(candle_time, '%Y-%m-%d %H:%M:%S') if candle_time else datetime.utcnow() timestamp = int((candle_time - datetime(1970, 1, 1)).total_seconds()) * 1000 - 5000 except ValueError: - raise Exception("Inapropriate date format, should be %Y-%m-%d %H:%M:%S") + raise Exception("Inappropriate date format, should be %Y-%m-%d %H:%M:%S") if event_type == 'Candle': clib.dxf_create_subscription_timed(sc.connection, et_type_int, timestamp, &sc.subscription) @@ -370,11 +370,11 @@ def dxf_close_connection(ConnectionClass cc): cc: ConnectionClass Variable with connection information """ - related_subs = cc.get_sub_refs() - for sub in related_subs: - dxf_close_subscription(sub) - if cc.connection: + related_subs = cc.get_sub_refs() + for sub in related_subs: + dxf_close_subscription(sub) + clib.dxf_close_connection(cc.connection) cc.connection = NULL