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:
@@ -44,7 +44,7 @@ public static class DependencyInjection
|
||||
.SetApplicationName("EmailProfiler");
|
||||
|
||||
// Register Background Workers
|
||||
services.AddHostedService<AsyncIniteWorker>();
|
||||
services.AddHostedService<AsyncInitWorker>();
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user