Refactor email queue worker and interface cleanup

Removed `InitAsync` from `IOutgoingEmailQueue` to decouple RabbitMQ initialization from the interface. Replaced `AsyncIniteWorker` with the correctly named `AsyncInitWorker` in `DependencyInjection.cs` and introduced a new, improved implementation of `AsyncInitWorker`.

The new `AsyncInitWorker` class initializes the outgoing email queue consumer using an event-driven RabbitMQ approach, with enhanced logging and error handling. Removed the outdated `AsyncIniteWorker` class to streamline the codebase.

These changes improve code clarity, maintainability, and correctness.
This commit is contained in:
2026-07-24 12:30:36 +02:00
parent d91ed70001
commit 3cba69ec42
4 changed files with 33 additions and 47 deletions

View File

@@ -44,7 +44,7 @@ public static class DependencyInjection
.SetApplicationName("EmailProfiler");
// Register Background Workers
services.AddHostedService<AsyncIniteWorker>();
services.AddHostedService<AsyncInitWorker>();
return services;
}