Repository navigation
HWs - #4
Open
StarostinLF wants to merge 9 commits into
Open
HWs#4StarostinLF wants to merge 9 commits into
StarostinLF wants to merge 9 commits into
Conversation
DevDenus
reviewed
Oct 4, 2026
| return | ||
|
|
||
| if path == "/mean": | ||
| message = await receive() |
There was a problem hiding this comment.
вход может прийти в несколько пакетов с more_body=True, в рамках этого дз некритично
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Что сделано
HW 1
application(чистый ASGI, без фреймворков);/factorial?n=— вычисление факториала;/fibonacci/<n>— вычисление числа Фибоначчи;/mean— среднее по списку чисел из JSON-тела;HW 2
cart(создание, получение по id, список с фильтрами, добавление товара) иitem(создание, получение по id, список с фильтрами, полная и частичная замена, удаление);Lecture 3 (HW 3)
lecture3/Dockerfile);docker-compose.ymlподнимает сервис, Prometheus и Grafana;/metricsчерезprometheus-fastapi-instrumentator, Prometheus собирает их каждые 10 секунд;Lecture 4 (HW 4)
lecture4/docker-compose.ymlдобавлен сервисmysql(MySQL 8, порт 3307). MySQL выбран, потому что в PostgresREAD UNCOMMITTEDработает какREAD COMMITTED, и dirty read там не показать.lecture4/hw/shop_api/main.py), вместо словарей в памяти используются таблицыshop_items,shop_carts,shop_cart_items. Тесты из HW 2 проходят.lecture4/hw/isolation.pyоткрывает два соединения (A и B) с нужным уровнем изоляции и показывает каждую аномалию:UPDATEвCOUNTпоявляется строка, вставленная B)Запуск:
docker compose up -d mysql, затемcd hw && pip install -r requirements.txt && python isolation.py(проверено в GitHub Codespaces).Вывод скрипта: