Olivier-Truong commited on
Commit
0d5fb6d
·
verified ·
1 Parent(s): 075bbdf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -37,16 +37,20 @@ def reloadData():
37
  global freeRooms
38
  while True:
39
  try:
40
- sleep(600)
41
- Ade = AdeRequest()
42
- infos = Ade.getRoomsInfos()
43
- freeRooms = Ade.getCurrentsFreeRooms()
44
- app.config['response_data'] = import_response_data() # [numRoom: str, capacity: int, freeUntil: str, busy: tuple]
45
- app.config['allowed'] = import_allowed() # [numRoom: str, freeUtil: str]
46
- print("[" + datetime.now().strftime("%y/%m/%d %H:%M:%S") + "] Refresh Data From Ade")
 
 
 
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()