Skip to content

Сукач Данил Лаб. 2 Группа 6511#22

Open
DanilSukach wants to merge 7 commits intoitsecd:mainfrom
DanilSukach:lab2
Open

Сукач Данил Лаб. 2 Группа 6511#22
DanilSukach wants to merge 7 commits intoitsecd:mainfrom
DanilSukach:lab2

Conversation

@DanilSukach
Copy link

ФИО: Сукач Данил
Номер группы: 6511
Номер лабораторной: 2
Номер варианта: 15
Краткое описание предметной области: Кредитная заявка
Краткое описание добавленных фич: Добавлен балансировщик нагрузки

@github-actions github-actions bot added In progress Код в процессе проверки Lab 2 Лабораторная №2. Балансировка нагрузки labels Mar 3, 2026
@github-actions github-actions bot requested a review from danlla March 3, 2026 14:02
@DanilSukach DanilSukach requested a review from danlla March 4, 2026 15:02
Comment on lines +62 to +70
lock (_lock)
{
if (_config.Services.Count == 0)
{
return Task.FromResult<Response<ServiceHostAndPort>>(
new ErrorResponse<ServiceHostAndPort>(new ServicesAreEmptyError("Weighted services list is empty")));
}

_currentIndex = (_currentIndex + 1) % _config.TotalWeight;
Copy link

Choose a reason for hiding this comment

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

lock лучше начать с обращения к _currentIndex, выше не должно быть проблем с потокобезопасностью

if (_config.Services.Count == 0)
{
return Task.FromResult<Response<ServiceHostAndPort>>(
new ErrorResponse<ServiceHostAndPort>(new ServicesAreEmptyError("Weighted services list is empty")));
Copy link

Choose a reason for hiding this comment

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

Тут наверно все же пустой список из сервисов генераторов

Comment on lines +88 to +89
return Task.FromResult<Response<ServiceHostAndPort>>(
new ErrorResponse<ServiceHostAndPort>(new ServicesAreEmptyError("Weighted services list is empty")));
Copy link

Choose a reason for hiding this comment

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

И тут тоже сообщение в ошибке стоит другое сделать
Тип тоже вряд ли подходит, но хотя бы сообщение поменять

@DanilSukach DanilSukach requested a review from danlla March 4, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

In progress Код в процессе проверки Lab 2 Лабораторная №2. Балансировка нагрузки

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants