Белякова Вероника Лаб. 3 Группа 6511#150
Open
Cat-sandwich wants to merge 12 commits into
Open
Conversation
Updated project description to include message queues and object storage details. Added new service for processing messages and saving files.
danlla
requested changes
May 15, 2026
| /// <param name="employee">данные сотрудника</param> | ||
| public async Task PublishAsync(EmployeeModel employee) | ||
| { | ||
| var queueUrl = string.Empty; |
| IAmazonSQS sqs, | ||
| ILogger<SqsPublisherService> logger) | ||
| { | ||
| private const string QueueName = "employee-queue"; |
Comment on lines
+45
to
+49
| new JsonSerializerOptions | ||
| { | ||
| Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping, | ||
| WriteIndented = true | ||
| }); |
There was a problem hiding this comment.
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); | ||
| } | ||
| } |
There was a problem hiding this comment.
Лучше вынести queueUrl в поле и проверять на null это поле до этого цикла, чтобы не запрашивать url на каждый запрос, а запросить только 1 раз при первом запросе
Comment on lines
+59
to
+61
| public async Task DisposeAsync() | ||
| { | ||
| } |
There was a problem hiding this comment.
Здесь нужно вызвать Dispose у тех сервисов, которые этого требуют
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
Номер лабораторной: 3
Номер варианта: 2
Краткое описание предметной области: Сотрудник компании
Краткое описание добавленных фич: Добавлена очередь сообщений и объектное хранилище. Написаны тесты