Skip to content

Commit 542dfd8

Browse files
heartbeat.py erstellen
1 parent 62de9fa commit 542dfd8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

comms/core/heartbeat.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import time
2+
import requests
3+
4+
SERVER = "http://core.webkurier/api/ping"
5+
6+
def check_lte():
7+
try:
8+
r = requests.get(SERVER, timeout=2)
9+
return r.status_code == 200
10+
except:
11+
return False
12+
13+
def loop():
14+
while True:
15+
status = check_lte()
16+
print("[HEARTBEAT] LTE:", status)
17+
time.sleep(2)
18+
19+
if __name__ == "__main__":
20+
loop()

0 commit comments

Comments
 (0)