Reduce polling request log noise
This commit is contained in:
@@ -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}")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user