浏览代码

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())