Hermes Agent commited on
Commit
5712326
·
1 Parent(s): 81c25f6

feat(sync): increase history sync limit to 1000 when user session client is active

Browse files
Files changed (1) hide show
  1. apex/tg_streamer.py +2 -1
apex/tg_streamer.py CHANGED
@@ -2520,7 +2520,8 @@ async def _sync_configured_channel_once():
2520
  results = []
2521
  for chat_id in targets:
2522
  try:
2523
- await _scan_chat_history(chat_id, limit=25, indexed_list=results)
 
2524
  except FloodWait as exc:
2525
  logger.info(f"[SYNC] FloodWait for {chat_id}; retrying after {exc.value}s")
2526
  await asyncio.sleep(exc.value)
 
2520
  results = []
2521
  for chat_id in targets:
2522
  try:
2523
+ sync_limit = int(os.environ.get("SYNC_HISTORY_LIMIT", "1000" if (tg_user and getattr(tg_user, "is_connected", False)) else "100"))
2524
+ await _scan_chat_history(chat_id, limit=sync_limit, indexed_list=results)
2525
  except FloodWait as exc:
2526
  logger.info(f"[SYNC] FloodWait for {chat_id}; retrying after {exc.value}s")
2527
  await asyncio.sleep(exc.value)