Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

feat: pochta-worker#53

Closed
savurov wants to merge 1 commit into
stagingfrom
feat/pochta-worker
Closed

feat: pochta-worker#53
savurov wants to merge 1 commit into
stagingfrom
feat/pochta-worker

Conversation

@savurov
Copy link
Copy Markdown
Contributor

@savurov savurov commented Oct 6, 2024

No description provided.

@savurov savurov requested a review from niqzart October 6, 2024 19:23
@savurov savurov self-assigned this Oct 6, 2024
Copy link
Copy Markdown
Member

@niqzart niqzart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хоба

Comment thread app/pochta/dependencies/redis_dep.py Outdated
Comment on lines +2 to +3

import redis
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: from-импорт

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Актуально везде

Comment thread app/pochta/dependencies/redis_dep.py Outdated
Comment on lines +12 to +13

RedisConnectionDep = Annotated[redis.asyncio.Redis, Depends(get_redis_connection)]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Это просто RedisConnection

Comment thread app/pochta/models.py Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: это не модель, это схема

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Вытащить это в common

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(if-minor)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вместо common пока просто вытащил в workers/pochta_rds.py

Comment thread app/pochta/routes/pochta_mub.py Outdated
Comment on lines +7 to +8

@router.get("/")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: И всё же это POST

Comment thread app/pochta/worker.py Outdated
Comment on lines +12 to +13

BLOCK_TIME_MS: int = 2000
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Final[int]

Comment thread app/pochta/main.py Outdated
Comment on lines +13 to +17
@redis_consumer(
stream_name=REDIS_POCHTA_STREAM, consumer_name="pochta_consumer", model=PochtaModel
)
async def process_email_message(message: PochtaModel) -> None:
print(f"Message: {message}") # noqa T201 # temporary print
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue(обсудили голосом): Это невозможно импортировать, надо чего-то подумать

Comment thread app/pochta/main.py Outdated
Comment on lines +20 to +14
@asynccontextmanager
async def lifespan() -> AsyncIterator[None]:
tasks = []
for worker in redis_consumers:
worker_task = asyncio.create_task(worker.run())
tasks.append(worker_task)
yield
for task in tasks:
task.cancel()


mub_router = APIRouterExt(prefix="/mub", dependencies=[MUBProtection])
mub_router.include_router(pochta_mub.router, prefix="/pochta")

api_router = APIRouterExt()
api_router.include_router(mub_router)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

polish: Обычно оно в обратном порядке

Comment thread docker-compose.yml Outdated
Comment thread pyproject.toml Outdated
Comment thread app/pochta/worker.py Outdated
Comment on lines +18 to +19

redis_consumers: list[RedisStreamConsumer] = []
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue(обсудили голосом): уф

@savurov savurov force-pushed the feat/pochta-worker branch 3 times, most recently from 8603fba to f654fd2 Compare October 12, 2024 15:54
@savurov savurov force-pushed the feat/pochta-worker branch from f654fd2 to ba5c2a3 Compare October 14, 2024 15:01
@niqzart niqzart force-pushed the feat/pochta-worker branch 2 times, most recently from 5f85af2 to ba5c2a3 Compare May 10, 2025 22:58
@niqzart
Copy link
Copy Markdown
Member

niqzart commented May 10, 2025

Закрыто в связи с переносом репозитория и изменения реализации в пользу использования FastStream

@niqzart niqzart closed this May 10, 2025
@niqzart niqzart deleted the feat/pochta-worker branch May 10, 2025 23:01
@niqzart niqzart mentioned this pull request May 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants