Skip to content

Белякова Вероника Лаб. 3 Группа 6511#150

Open
Cat-sandwich wants to merge 12 commits into
itsecd:mainfrom
Cat-sandwich:main
Open

Белякова Вероника Лаб. 3 Группа 6511#150
Cat-sandwich wants to merge 12 commits into
itsecd:mainfrom
Cat-sandwich:main

Conversation

@Cat-sandwich
Copy link
Copy Markdown

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

@github-actions github-actions Bot added In progress Код в процессе проверки Lab 3 Лабораторная №3. Интеграционное тестирование labels May 13, 2026
@github-actions github-actions Bot requested a review from danlla May 13, 2026 19:32
/// <param name="employee">данные сотрудника</param>
public async Task PublishAsync(EmployeeModel employee)
{
var queueUrl = string.Empty;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Лишняя инициализация переменной

IAmazonSQS sqs,
ILogger<SqsPublisherService> logger)
{
private const string QueueName = "employee-queue";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Эта константа нигде не используется

Comment on lines +45 to +49
new JsonSerializerOptions
{
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
WriteIndented = true
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

JsonSerializerOptions лучше вынести в поле и переиспользовать здесь это поле, вместо создания нового объекта на каждый запрос

Comment on lines +26 to +41
while (true)
{
try
{
var response = await sqs.GetQueueUrlAsync("employee-queue");

queueUrl = response.QueueUrl;

break;
}
catch
{
logger.LogInformation("Waiting for SQS queue...");
await Task.Delay(2000);
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Лучше вынести queueUrl в поле и проверять на null это поле до этого цикла, чтобы не запрашивать url на каждый запрос, а запросить только 1 раз при первом запросе

Comment on lines +59 to +61
public async Task DisposeAsync()
{
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Здесь нужно вызвать Dispose у тех сервисов, которые этого требуют

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

In progress Код в процессе проверки Lab 3 Лабораторная №3. Интеграционное тестирование

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants