Beracles commited on
Commit
5924ba7
·
1 Parent(s): 5ee7e9c

move time printing

Browse files
Files changed (1) hide show
  1. app_util.py +8 -1
app_util.py CHANGED
@@ -1,17 +1,20 @@
1
  import json
2
 
3
  from gradio_client import Client
 
4
 
5
 
6
  def call_logger(log_info, caller, hf_token) -> None:
7
  #######################
8
  # logging
9
  #######################
 
 
 
10
  urls = [
11
  "https://hubei-hunan-logger.hf.space",
12
  "https://hubei-hunan-logger2.hf.space",
13
  ]
14
-
15
  for url in urls:
16
  try:
17
  client = Client(
@@ -23,6 +26,10 @@ def call_logger(log_info, caller, hf_token) -> None:
23
  print(f"[logging to {url}] OK")
24
  except Exception as e:
25
  print(f"[logging to {url}] error: {e}")
 
 
 
 
26
 
27
 
28
  def call_clouddisk(service, arg, hf_token) -> str | None:
 
1
  import json
2
 
3
  from gradio_client import Client
4
+ from pgsoft.pgdate.date_utils import beijing
5
 
6
 
7
  def call_logger(log_info, caller, hf_token) -> None:
8
  #######################
9
  # logging
10
  #######################
11
+ calling_start = beijing()
12
+ print(f"calling logger starts at {beijing()}")
13
+ #################################################
14
  urls = [
15
  "https://hubei-hunan-logger.hf.space",
16
  "https://hubei-hunan-logger2.hf.space",
17
  ]
 
18
  for url in urls:
19
  try:
20
  client = Client(
 
26
  print(f"[logging to {url}] OK")
27
  except Exception as e:
28
  print(f"[logging to {url}] error: {e}")
29
+ #################################################
30
+ calling_end = beijing()
31
+ timecost = calling_end.timestamp() - calling_start.timestamp()
32
+ print(f"calling logger ends at {calling_end}, costs {timecost:.2f}s")
33
 
34
 
35
  def call_clouddisk(service, arg, hf_token) -> str | None: