load-random-topic-fix
All checks were successful
deploy / deploy (push) Successful in 1m30s

This commit is contained in:
2023-12-25 01:06:27 +03:00
parent c236768c07
commit 0ea9f45854
4 changed files with 16 additions and 18 deletions

View File

@@ -22,13 +22,13 @@ logger.setLevel(logging.DEBUG)
@event.listens_for(Engine, "before_cursor_execute")
def before_cursor_execute(conn, cursor, statement, parameters, context, executemany):
conn.info.setdefault("query_start_time", []).append(time.time())
logger.debug(f" {statement}")
# logger.debug(f" {statement}")
@event.listens_for(Engine, "after_cursor_execute")
def after_cursor_execute(conn, cursor, statement, parameters, context, executemany):
total = time.time() - conn.info["query_start_time"].pop(-1)
logger.debug(f" Finished in {math.floor(total*10000)/10} ms ")
print(f" ----------------- Finished in {math.floor(total*10000)/10} ms ")
engine = create_engine(DB_URL, echo=False, pool_size=10, max_overflow=20)