@@ -984,6 +984,15 @@ cdef class DataEngine(Component):
984
984
return
985
985
Condition.not_none(client, " client" )
986
986
987
+ if not params.get(" start" ):
988
+ last_timestamp: datetime | None = self ._catalogs_last_timestamp(
989
+ QuoteTick,
990
+ instrument_id,
991
+ )[0 ]
992
+
993
+ params = params if params else {}
994
+ params[" start" ] = last_timestamp
995
+
987
996
if instrument_id not in client.subscribed_quote_ticks():
988
997
client.subscribe_quote_ticks(instrument_id, params)
989
998
@@ -1025,6 +1034,15 @@ cdef class DataEngine(Component):
1025
1034
return
1026
1035
Condition.not_none(client, " client" )
1027
1036
1037
+ if not params.get(" start" ):
1038
+ last_timestamp: datetime | None = self ._catalogs_last_timestamp(
1039
+ TradeTick,
1040
+ instrument_id,
1041
+ )[0 ]
1042
+
1043
+ params = params if params else {}
1044
+ params[" start" ] = last_timestamp
1045
+
1028
1046
if instrument_id not in client.subscribed_trade_ticks():
1029
1047
client.subscribe_trade_ticks(instrument_id, params)
1030
1048
@@ -1076,6 +1094,15 @@ cdef class DataEngine(Component):
1076
1094
)
1077
1095
return
1078
1096
1097
+ if not params.get(" start" ):
1098
+ last_timestamp: datetime | None = self ._catalogs_last_timestamp(
1099
+ Bar,
1100
+ bar_type = bar_type,
1101
+ )[0 ]
1102
+
1103
+ params = params if params else {}
1104
+ params[" start" ] = last_timestamp
1105
+
1079
1106
if bar_type not in client.subscribed_bars():
1080
1107
client.subscribe_bars(bar_type, params)
1081
1108
@@ -1090,6 +1117,12 @@ cdef class DataEngine(Component):
1090
1117
1091
1118
try :
1092
1119
if data_type not in client.subscribed_custom_data():
1120
+ if not params.get(" start" ):
1121
+ last_timestamp: datetime | None = self ._catalogs_last_timestamp(data_type.type)[0 ]
1122
+
1123
+ params = params if params else {}
1124
+ params[" start" ] = last_timestamp
1125
+
1093
1126
client.subscribe(data_type, params)
1094
1127
except NotImplementedError :
1095
1128
self ._log.error(
@@ -1419,10 +1452,10 @@ cdef class DataEngine(Component):
1419
1452
datetime end,
1420
1453
dict params,
1421
1454
):
1422
- last_timestamp, _ = self ._catalogs_last_timestamp(
1455
+ last_timestamp = self ._catalogs_last_timestamp(
1423
1456
Instrument,
1424
1457
instrument_id,
1425
- )
1458
+ )[ 0 ]
1426
1459
1427
1460
if last_timestamp:
1428
1461
self ._query_catalog(request)
@@ -1474,10 +1507,10 @@ cdef class DataEngine(Component):
1474
1507
):
1475
1508
instrument_id = request.data_type.metadata.get(" instrument_id" )
1476
1509
1477
- last_timestamp, _ = self ._catalogs_last_timestamp(
1510
+ last_timestamp = self ._catalogs_last_timestamp(
1478
1511
QuoteTick,
1479
1512
instrument_id,
1480
- )
1513
+ )[ 0 ]
1481
1514
1482
1515
if last_timestamp:
1483
1516
if (now <= last_timestamp) or (end and end <= last_timestamp):
@@ -1515,10 +1548,10 @@ cdef class DataEngine(Component):
1515
1548
):
1516
1549
instrument_id = request.data_type.metadata.get(" instrument_id" )
1517
1550
1518
- last_timestamp, _ = self ._catalogs_last_timestamp(
1551
+ last_timestamp = self ._catalogs_last_timestamp(
1519
1552
TradeTick,
1520
1553
instrument_id,
1521
- )
1554
+ )[ 0 ]
1522
1555
1523
1556
if last_timestamp:
1524
1557
if (now <= last_timestamp) or (end and end <= last_timestamp):
@@ -1556,10 +1589,10 @@ cdef class DataEngine(Component):
1556
1589
):
1557
1590
bar_type = request.data_type.metadata.get(" bar_type" )
1558
1591
1559
- last_timestamp, _ = self ._catalogs_last_timestamp(
1592
+ last_timestamp = self ._catalogs_last_timestamp(
1560
1593
Bar,
1561
1594
bar_type = bar_type,
1562
- )
1595
+ )[ 0 ]
1563
1596
1564
1597
if last_timestamp:
1565
1598
if (now <= last_timestamp) or (end and end <= last_timestamp):
@@ -1595,9 +1628,9 @@ cdef class DataEngine(Component):
1595
1628
datetime now,
1596
1629
dict params,
1597
1630
):
1598
- last_timestamp, _ = self ._catalogs_last_timestamp(
1631
+ last_timestamp = self ._catalogs_last_timestamp(
1599
1632
request.data_type.type,
1600
- )
1633
+ )[ 0 ]
1601
1634
1602
1635
if last_timestamp:
1603
1636
if (now <= last_timestamp) or (end and end <= last_timestamp):
0 commit comments