Araeynn commited on
Commit
f8ae7f5
1 Parent(s): 72bece2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -18,8 +18,10 @@ launch_time = datetime.datetime.utcnow()
18
  ph = st.empty()
19
 
20
  def syncMessages():
 
 
21
  with ph.container():
22
- delta_uptime = datetime.datetime.utcnow() - launch_time
23
  hours, remainder = divmod(int(delta_uptime.total_seconds()), 3600)
24
  minutes, seconds = divmod(remainder, 60)
25
  days, hours = divmod(hours, 24)
@@ -50,7 +52,7 @@ lock_file_path = "test.txt"
50
 
51
  if not os.path.exists(lock_file_path):
52
  with open(lock_file_path, "w") as f:
53
- f.write("Running!")
54
  clone = False
55
  st.markdown("Bot is running, reload the page to see activity.")
56
  else:
 
18
  ph = st.empty()
19
 
20
  def syncMessages():
21
+ with open("test.txt", "r") as f:
22
+ r = f.read()
23
  with ph.container():
24
+ delta_uptime = datetime.datetime.utcnow() - datetime.utcfromtimestamp(int(r))
25
  hours, remainder = divmod(int(delta_uptime.total_seconds()), 3600)
26
  minutes, seconds = divmod(remainder, 60)
27
  days, hours = divmod(hours, 24)
 
52
 
53
  if not os.path.exists(lock_file_path):
54
  with open(lock_file_path, "w") as f:
55
+ f.write(str(int(launch_time)))
56
  clone = False
57
  st.markdown("Bot is running, reload the page to see activity.")
58
  else: