Skip to content

Commit

Permalink
feat: allow force update for JqkaEmotionRecorder
Browse files Browse the repository at this point in the history
  • Loading branch information
lonelam committed Nov 2, 2024
1 parent b06ba51 commit 16c8756
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/zvt/recorders/jqka/emotion/JqkaEmotionRecorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def init_timestamps(self, entity_item) -> List[pd.Timestamp]:
latest_infos = LimitUpInfo.query_data(
provider=self.provider, order=LimitUpInfo.timestamp.desc(), limit=1, return_type="domain"
)
if latest_infos:
if latest_infos and not self.force_update:
start_date = latest_infos[0].timestamp
else:
# 最近一年的数据
Expand Down Expand Up @@ -99,7 +99,7 @@ def init_timestamps(self, entity_item) -> List[pd.Timestamp]:
latest_infos = LimitDownInfo.query_data(
provider=self.provider, order=LimitDownInfo.timestamp.desc(), limit=1, return_type="domain"
)
if latest_infos:
if latest_infos and not self.force_update:
start_date = latest_infos[0].timestamp
else:
# 最近一年的数据
Expand Down Expand Up @@ -163,7 +163,7 @@ def init_timestamps(self, entity_item) -> List[pd.Timestamp]:
latest_infos = Emotion.query_data(
provider=self.provider, order=Emotion.timestamp.desc(), limit=1, return_type="domain"
)
if latest_infos:
if latest_infos and not self.force_update:
start_date = latest_infos[0].timestamp
else:
# 最近一年的数据
Expand Down Expand Up @@ -205,8 +205,8 @@ def record(self, entity, start, end, size, timestamps):


if __name__ == "__main__":
JqkaLimitDownRecorder().run()

# JqkaLimitDownRecorder().run()
LimitDownInfo.record_data(start_timestamp="2024-02-02", end_timestamp="2024-02-16", force_update=True)

# the __all__ is generated
__all__ = ["JqkaLimitUpRecorder", "JqkaLimitDownRecorder", "JqkaEmotionRecorder"]

0 comments on commit 16c8756

Please sign in to comment.