This commit is contained in:
@@ -34,12 +34,7 @@ async def check_auth(req):
|
||||
logger.debug(f'{token}')
|
||||
query_name = 'validate_jwt_token'
|
||||
operation = 'ValidateToken'
|
||||
variables = {
|
||||
'params': {
|
||||
'token_type': 'access_token',
|
||||
'token': token,
|
||||
}
|
||||
}
|
||||
variables = {'params': {'token_type': 'access_token', 'token': token}}
|
||||
|
||||
gql = {
|
||||
'query': f'query {operation}($params: ValidateJWTTokenInput!) {{'
|
||||
|
@@ -33,9 +33,7 @@ def after_cursor_execute(conn, cursor, statement, parameters, context, executema
|
||||
elapsed = time.time() - conn.query_start_time
|
||||
del conn.query_start_time
|
||||
if elapsed > 0.9: # Adjust threshold as needed
|
||||
logger.debug(
|
||||
f"\n{statement}\n{'*' * math.floor(elapsed)} {elapsed:.3f} s"
|
||||
)
|
||||
logger.debug(f"\n{statement}\n{'*' * math.floor(elapsed)} {elapsed:.3f} s")
|
||||
|
||||
|
||||
def local_session(src=''):
|
||||
|
@@ -12,13 +12,11 @@ from services.rediscache import redis
|
||||
DEFAULT_FOLLOWS = {
|
||||
'topics': [],
|
||||
'authors': [],
|
||||
'communities': [
|
||||
{'slug': 'discours', 'name': 'Дискурс', 'id': 1, 'desc': ''}
|
||||
],
|
||||
'communities': [{'slug': 'discours', 'name': 'Дискурс', 'id': 1, 'desc': ''}],
|
||||
}
|
||||
|
||||
|
||||
async def update_author(author: Author, ttl = 25 * 60 * 60):
|
||||
async def update_author(author: Author, ttl=25 * 60 * 60):
|
||||
redis_key = f'user:{author.user}:author'
|
||||
await redis.execute('SETEX', redis_key, ttl, json.dumps(author.dict()))
|
||||
|
||||
|
Reference in New Issue
Block a user