Skip to content

Commit 31ca603

Browse files
authored
Improve the log time function for 10 minute + renders (#6207)
* modified: main.py * Update main.py
1 parent f7fb193 commit 31ca603

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

main.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,13 @@ def prompt_worker(q, server_instance):
185185

186186
current_time = time.perf_counter()
187187
execution_time = current_time - execution_start_time
188-
logging.info("Prompt executed in {:.2f} seconds".format(execution_time))
188+
189+
# Log Time in a more readable way after 10 minutes
190+
if execution_time > 600:
191+
execution_time = time.strftime("%H:%M:%S", time.gmtime(execution_time))
192+
logging.info(f"Prompt executed in {execution_time}")
193+
else:
194+
logging.info("Prompt executed in {:.2f} seconds".format(execution_time))
189195

190196
flags = q.get_flags()
191197
free_memory = flags.get("free_memory", False)

0 commit comments

Comments
 (0)