info-fix
All checks were successful
Deploy to core / deploy (push) Successful in 1m42s

This commit is contained in:
Untone 2024-01-29 13:02:14 +03:00
parent 774a5ee596
commit 325927739e
5 changed files with 9 additions and 9 deletions

2
.gitignore vendored
View File

@ -149,4 +149,4 @@ dev-server.pid
backups/
poetry.lock
.ruff_cache
dev-server.pid
.jj

View File

@ -159,7 +159,7 @@ def topic_follow(follower_id, slug):
topic = session.query(Topic).where(Topic.slug == slug).one()
_following = TopicFollower(topic=topic.id, follower=follower_id)
return True
except Exception:
except Exception as _exc:
return False

View File

@ -48,7 +48,9 @@ async def check_auth(req) -> str | None:
}
gql = {
'query': f'query {operation}($params: ValidateJWTTokenInput!) {{ {query_name}(params: $params) {{ is_valid claims }} }}',
'query': f'query {operation}($params: ValidateJWTTokenInput!) {{' +
f'{query_name}(params: $params) {{ is_valid claims }} ' +
'}',
'variables': variables,
'operationName': operation,
}

View File

@ -14,7 +14,7 @@ logger = logging.getLogger('\t[services.search]\t')
logger.setLevel(logging.DEBUG)
ELASTIC_HOST = (
os.environ.get('ELASTIC_HOST', '').replace('https://', '').replace('http://', '')
os.environ.get('ELASTIC_HOST', '').replace('https://', '')
)
ELASTIC_USER = os.environ.get('ELASTIC_USER', '')
ELASTIC_PASSWORD = os.environ.get('ELASTIC_PASSWORD', '')
@ -99,8 +99,8 @@ class SearchService:
self.client = None
def info(self):
if self.client:
logger.info(f' Поиск подключен: {self.client.host}')
if isinstance(self.client, OpenSearch):
logger.info(f' Поиск подключен: {self.client.info()}')
else:
logger.info(' * Задайте переменные среды для подключения к серверу поиска')
@ -119,8 +119,6 @@ class SearchService:
)
self.client.indices.close(index=self.index_name)
self.client.indices.open(index=self.index_name)
except Exception as _exc: # noqa: S110
pass
finally:
self.lock.release()
else:

View File

@ -197,7 +197,7 @@ class ViewedStorage:
try:
await self.update_pages()
failed = 0
except Exception:
except Exception as _exc:
failed += 1
logger.info(' - Обновление не удалось #%d, ожидание 10 секунд' % failed)
if failed > 3: