Reduce polling request log noise

This commit is contained in:
Dymas
2026-05-17 21:20:24 +02:00
parent ae090c954b
commit d0af0258f2
6 changed files with 34 additions and 3 deletions
+4
View File
@@ -70,6 +70,7 @@ def dependency_status():
class Handler(BaseHTTPRequestHandler):
server_version = "AniCliWeb/1.0"
remote_token_cookie_name = "ani_cli_web_token"
quiet_poll_paths = {"/api/queue", "/api/watchlist/refresh-status"}
def _context(self):
context = getattr(self, "handler_context", None) or getattr(type(self), "handler_context", None)
@@ -467,6 +468,9 @@ class Handler(BaseHTTPRequestHandler):
self.error(HTTPStatus.INTERNAL_SERVER_ERROR, "Internal server error.")
def log_message(self, fmt, *args):
parsed = urlparse(getattr(self, "path", "") or "")
if self.command == "GET" and parsed.path in Handler.quiet_poll_paths:
return
print(f"{self.address_string()} - {fmt % args}")