Skip to content

Commit fb42ab5

Browse files
committed
fix: #826
1 parent 413b5d9 commit fb42ab5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

store/zhihu/_store_impl.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ async def store_content(self, content_item: Dict):
113113
if hasattr(existing_content, key):
114114
setattr(existing_content, key, value)
115115
else:
116+
if "add_ts" not in content_item:
117+
content_item["add_ts"] = utils.get_current_timestamp()
116118
new_content = ZhihuContent(**content_item)
117119
session.add(new_content)
118120
await session.commit()
@@ -133,6 +135,8 @@ async def store_comment(self, comment_item: Dict):
133135
if hasattr(existing_comment, key):
134136
setattr(existing_comment, key, value)
135137
else:
138+
if "add_ts" not in comment_item:
139+
comment_item["add_ts"] = utils.get_current_timestamp()
136140
new_comment = ZhihuComment(**comment_item)
137141
session.add(new_comment)
138142
await session.commit()
@@ -153,6 +157,8 @@ async def store_creator(self, creator: Dict):
153157
if hasattr(existing_creator, key):
154158
setattr(existing_creator, key, value)
155159
else:
160+
if "add_ts" not in creator:
161+
creator["add_ts"] = utils.get_current_timestamp()
156162
new_creator = ZhihuCreator(**creator)
157163
session.add(new_creator)
158164
await session.commit()

0 commit comments

Comments
 (0)