-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/send message #185
base: develop
Are you sure you want to change the base?
Feature/send message #185
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Возможно я упустил какие-то договоренности. И это драфтовый ПР?
@@ -139,3 +139,9 @@ dmypy.json | |||
|
|||
# vscode | |||
.vscode | |||
|
|||
# .gitignore | |||
src/bot/static/css/bootstrap.rtl.min.css.map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не совсем понятно, почему в игноре именно эти 4 файла?
Смотрю добавлено много css. Точно ли необходимо нам это всё?
Через CDN не предлагаю, но есть такое подозрение, что далеко не вся эта статика нам необходима)
from pydantic import BaseSettings | ||
|
||
load_dotenv() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А разве нам нужно тут загружать переменные окружения? Если мы вызываем уже там где к ним обращаемся
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
с app.py не понял. У нас точка входа же в другом файле. А тут мы заново пишем и иницируем
# Ожидание 1/30 секунды перед отправкой | ||
|
||
|
||
async def send_messages( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
По хорошему все функции отправки сообщения тогда уже убрать в другое место. Даже создать в структуре отдельную папку, будет удобнее для масштабирования
) | ||
static_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'static') | ||
app.mount('/static', StaticFiles(directory=static_dir), name='static') | ||
message_queue = asyncio.Queue() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Кажется, что можно использовать jobqueue, которая есть во фреймворке
@@ -17,7 +17,7 @@ line-ending = "lf" | |||
quote-style = "single" | |||
|
|||
[lint] | |||
ignore=["E265", "F811", "D100", "D105", "D104", "D203", "D211", "D213", "N818", "W505", "ANN401"] | |||
ignore=["E265", "F811", "D100", "D105", "D104", "D203", "D211", "D213", "N818", "W505", "ANN401", "COM812"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Этот файл правим по согласованию со мной или Константином.
@@ -1,2 +1,2 @@ | |||
from app.core.db import Base # noqa | |||
from app.models import Group, Message, Photo, UserTG, UserGroupAssociation # noqa | |||
from src.app.core.db import Base # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src
не нужно.
from sqlalchemy.ext.asyncio import AsyncSession | ||
from sqlalchemy.future import select | ||
|
||
from app.crud.base import CRUDBase | ||
from app.models.models import UserTG | ||
from src.app.crud.base import CRUDBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src
не нужно
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачем на здесь весь bootstrap?
Достаточно bootstrap.css и bootstarp.bundle.js
Реализована функция отправки сообщений пользователям с привязкой к БД и связкой с html формой.