Замотохина Мария Лаб. 2 Группа 6511#91
Open
ZamotohinaMaria wants to merge 15 commits intoitsecd:mainfrom
Open
Conversation
danlla
requested changes
Apr 8, 2026
Comment on lines
+36
to
+39
| <details> | ||
| <summary> | ||
| Логи запуска генераторов | ||
| </summary> |
There was a problem hiding this comment.
Изображения в этой секции не отображаются, возможно с отступами проблемы
Comment on lines
+43
to
+50
| for (var i = 0; i < servicesCount; i++) | ||
| { | ||
| var weight = i < _weights.Length ? _weights[i] : 1; | ||
| if (weight < 1) weight = 1; | ||
|
|
||
| for (var j = 0; j < weight; j++) | ||
| wheel.Add(i); | ||
| } |
There was a problem hiding this comment.
Эта реализация лучше, чем вариант при котором делается список из сервисов, но большой список в памяти можно и здесь получить, если будут большие веса
Но можно и так оставить
| return new ErrorResponse<ServiceHostAndPort>( | ||
| new ServicesAreNullError("No downstream services are available")); | ||
|
|
||
| var wheel = BuildWheel(services.Count); |
There was a problem hiding this comment.
Возможно имеет смысл делать это в конструкторе 1 раз
Comment on lines
+5
to
+6
| var builder = WebApplication.CreateBuilder(args); | ||
|
|
There was a problem hiding this comment.
Не хватает builder.AddServiceDefaults();
MedicalPatient.Generator/Program.cs
Outdated
Comment on lines
+14
to
+22
| builder.Services.AddCors(options => | ||
| { | ||
| options.AddDefaultPolicy(policy => | ||
| { | ||
| policy.AllowAnyOrigin() | ||
| .AllowAnyMethod() | ||
| .AllowAnyHeader(); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Во 2 лабе cors нужно перенести в ApiGateway, так как клиент взаимодействует теперь с ним
Также нужно настроить с помощью метода WithOrigins доступ только для клиентских origins
| @@ -0,0 +1,59 @@ | |||
| using System.Threading; | |||
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.
ФИО: Замотохина Мария
Номер группы: 6511
Номер лабораторной: 2
Номер варианта: 6
Краткое описание предметной области: Медицинский пациент
Краткое описание добавленных фич: Реализован api gateway для класса медицинский работник на основе Ocelot, имплементирован алгоритм балансировки Weighted Round Robin, для чего была написана собственная реализация алгоритма в отдельном классе