Relax rate limits, reduce SSH warning noise, add step logging helpers
This commit is contained in:
1 parent
7f3ef08e7e
commit
27d87b3d31
4 files changed
+68
-15
No files matched your search
@@ -107,14 +107,14 @@ class ChatService:
|
||||
logger.warning("Cannot catch up - no text-router pod found")
|
||||
return 0
|
||||
|
||||
logger.info(f"Attempting to catch up chat from pod: {pod_name}")
|
||||
logger.debug(f"Attempting to catch up chat from pod: {pod_name}")
|
||||
|
||||
# Get pod logs first, then filter locally
|
||||
log_cmd = f"sudo kubectl logs -n {namespace} {pod_name} --tail=2000 2>/dev/null"
|
||||
out, err, rc = self.ssh.run(log_cmd, timeout=30)
|
||||
|
||||
if rc != 0 or not out:
|
||||
logger.warning(f"Cannot catch up - failed to get pod logs: {err}")
|
||||
logger.debug(f"Cannot catch up - failed to get pod logs (rc={rc})")
|
||||
return 0
|
||||
|
||||
# Filter for chat messages locally
|
||||
|
||||
+2
-1
@@ -85,7 +85,8 @@ class SSHService:
|
||||
err = stderr.read().decode('utf-8', errors='replace')
|
||||
rc = stdout.channel.recv_exit_status()
|
||||
if rc != 0:
|
||||
logger.warning("SSH command failed (rc=%d): %s", rc, err[:200])
|
||||
cmd_short = command[:80] + '...' if len(command) > 80 else command
|
||||
logger.warning("SSH command failed (rc=%d): cmd=%s err=%s", rc, cmd_short, err[:100] if err else 'none')
|
||||
return out, err, rc
|
||||
except paramiko.SSHException as e:
|
||||
logger.error("SSH command error: %s", e)
|
||||
|
||||
Reference in new issue
Block a user