소스 검색

traffic: ignore our own monitoring requests

Rodja Trappe 2 년 전
부모
커밋
b243c69755
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      traffic_tracking.py

+ 3 - 0
traffic_tracking.py

@@ -40,6 +40,9 @@ class TrafficChard(ui.chart):
         })
 
     def on_connect(self, request: Request) -> None:
+        if request.client.host == '206.81.24.204':
+            return  # ignore monitoring requests from zauberzeug
+
         def seconds_to_day(seconds: float) -> int: return int(seconds / 60 / 60 / 24)
         def day_to_milliseconds(day: int) -> float: return day * 24 * 60 * 60 * 1000
         today = seconds_to_day(time.time())