Skip to content

Commit ac7765b

Browse files
bakerboy448claude
andcommitted
Fix continuous mode to preserve existing wiki entries
- Continuous mode now rebuilds wiki from ALL database actions (like single-run mode) - Previously only showed new actions, causing existing entries to disappear - Now matches single-run mode behavior: process new actions, then rebuild full wiki - Preserves historical entries within retention period 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b82c708 commit ac7765b

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

modlog_wiki_publisher.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,13 +1186,22 @@ def run_continuous_mode(reddit, config: Dict[str, Any], force: bool = False):
11861186
while True:
11871187
try:
11881188
error_count = 0 # Reset on successful run
1189-
actions = process_modlog_actions(reddit, config)
1189+
new_actions = process_modlog_actions(reddit, config)
11901190

1191-
if actions:
1192-
content = build_wiki_content(actions, config)
1191+
if new_actions:
1192+
logger.info(f"Processed {len(new_actions)} new modlog actions")
1193+
1194+
# Always rebuild wiki from ALL relevant actions in database (within retention period)
1195+
# This matches the behavior of single-run mode
1196+
all_actions = get_recent_actions_from_db(config, force_all_actions=False, show_only_removals=True)
1197+
if all_actions:
1198+
logger.info(f"Found {len(all_actions)} total actions in database for wiki update")
1199+
content = build_wiki_content(all_actions, config)
11931200
wiki_page = config.get('wiki_page', 'modlog')
11941201
update_wiki_page(reddit, config['source_subreddit'], wiki_page, content, force=first_run_force)
11951202
first_run_force = False
1203+
else:
1204+
logger.warning("No actions found in database for wiki update")
11961205

11971206
cleanup_old_entries(get_config_with_default(config, 'retention_days'))
11981207

0 commit comments

Comments
 (0)