Speed up daily reindex: skip empty JSON rewrites and upsert only changed posts.
Keep channel mtime stable when merge finds no new posts, and rebuild FTS only for new/changed content so large daily channels stay cheap. Drop --reindex-all from renew.sh for incremental runs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -624,6 +624,10 @@ def export_channel(d: Driver, channel: str, user_id_to_name: Dict[str, str], out
|
||||
merged_posts.append(post)
|
||||
seen_ids.add(post["id"])
|
||||
new_count += 1
|
||||
if new_count == 0:
|
||||
# Keep mtime stable so mm_index can skip this channel file.
|
||||
print(f" no new posts, leaving '{output_filepath}' unchanged")
|
||||
return
|
||||
merged_posts.sort(key=lambda p: p["created"])
|
||||
for i, post in enumerate(merged_posts):
|
||||
post["idx"] = i
|
||||
|
||||
Reference in New Issue
Block a user