+3
-3
x.py
+3
-3
x.py
···
1341
1341
logger.warning(f"❌ No conversation_id found for mention {mention_id} - this may cause thread context issues")
1342
1342
return None
1343
1343
1344
-
# Get thread context (disable cache for missing context issues)
1344
+
# Get thread context with caching enabled for efficiency
1345
1345
# Use mention_id as until_id to exclude tweets that occurred after this mention
1346
1346
try:
1347
-
thread_data = x_client.get_thread_context(conversation_id, use_cache=False, until_id=mention_id)
1347
+
thread_data = x_client.get_thread_context(conversation_id, use_cache=True, until_id=mention_id)
1348
1348
if not thread_data:
1349
1349
logger.error(f"❌ Failed to get thread context for conversation {conversation_id}")
1350
1350
return False
···
1978
1978
logger.info("Connected to X API")
1979
1979
1980
1980
# Main loop
1981
-
FETCH_DELAY_SEC = 60 # Check every minute for X mentions
1981
+
FETCH_DELAY_SEC = 120 # Check every 2 minutes for X mentions (reduced from 60s to conserve API calls)
1982
1982
logger.info(f"Starting X mention monitoring, checking every {FETCH_DELAY_SEC} seconds")
1983
1983
1984
1984
if testing_mode: