Spaces:
Running
Running
Olivier-Truong
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -37,16 +37,20 @@ def reloadData():
|
|
37 |
global freeRooms
|
38 |
while True:
|
39 |
try:
|
40 |
-
sleep(600)
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
47 |
|
48 |
except Exception as e:
|
49 |
print("Err. When reload:", e)
|
|
|
50 |
|
51 |
|
52 |
Thread(target=reloadData).start()
|
|
|
37 |
global freeRooms
|
38 |
while True:
|
39 |
try:
|
40 |
+
#sleep(600)
|
41 |
+
if datetime.now().minute % 20 == 0:
|
42 |
+
Ade = AdeRequest()
|
43 |
+
infos = Ade.getRoomsInfos()
|
44 |
+
freeRooms = Ade.getCurrentsFreeRooms()
|
45 |
+
app.config['response_data'] = import_response_data() # [numRoom: str, capacity: int, freeUntil: str, busy: tuple]
|
46 |
+
app.config['allowed'] = import_allowed() # [numRoom: str, freeUtil: str]
|
47 |
+
print("[" + datetime.now().strftime("%y/%m/%d %H:%M:%S") + "] Refresh Data From Ade")
|
48 |
+
sleep(120)
|
49 |
+
sleep(10)
|
50 |
|
51 |
except Exception as e:
|
52 |
print("Err. When reload:", e)
|
53 |
+
sleep(30)
|
54 |
|
55 |
|
56 |
Thread(target=reloadData).start()
|