we-all-made-of-stars
All checks were successful
Deploy to core / deploy (push) Successful in 1m21s

This commit is contained in:
Untone 2024-02-19 14:54:13 +03:00
parent 37230a8392
commit 75edee4fe9

View File

@ -1,4 +1,5 @@
import logging import logging
import math
import time import time
from functools import wraps from functools import wraps
from typing import Any, Callable, Dict, TypeVar from typing import Any, Callable, Dict, TypeVar
@ -38,7 +39,8 @@ def before_cursor_execute(conn, cursor, statement, parameters, context, executem
@event.listens_for(Engine, 'after_cursor_execute') @event.listens_for(Engine, 'after_cursor_execute')
def after_cursor_execute(conn, cursor, statement, parameters, context, executemany): def after_cursor_execute(conn, cursor, statement, parameters, context, executemany):
total = time.time() - conn.info['query_start_time'].pop(-1) total = time.time() - conn.info['query_start_time'].pop(-1)
logger.debug(f' ... {total*1000} s\n') stars = '*' * math.floor(total*1000)
logger.debug(f' {stars} {total*1000} s\n')
def local_session(src=''): def local_session(src=''):
return Session(bind=engine, expire_on_commit=False) return Session(bind=engine, expire_on_commit=False)