Skip to content

Commit 1a5ed58

Browse files
author
Timothy Dodd
committed
Refactor email processing with move queue integration
Updated `Program.cs` to register `EmailMoveQueue` and `IEmailMoveQueue` for managing email move operations. Refactored `EmailMonitoringService.cs` to improve email processing and connection handling, and to utilize the new move queue. Simplified `EmailMover.cs` by decoupling IMAP interactions and leveraging the move queue. Introduced `EmailMoveOperation` and `EmailMovedEventArgs` classes in `EmailMoveQueue.cs` to manage move operations and events. Overall, these changes enhance the modularity and scalability of the email processing system.
1 parent b544684 commit 1a5ed58

4 files changed

Lines changed: 449 additions & 373 deletions

File tree

src/MailZort/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ static async Task Main(string[] args)
4242
services.AddSingleton<IEmailHandler, EmailHandler>();
4343
services.AddSingleton<RuleMatcher>();
4444
services.AddSingleton(x => settingHelper);
45+
services.AddSingleton<EmailMoveQueue>(); // Singleton to share state
46+
services.AddSingleton<IEmailMoveQueue>(provider => provider.GetService<EmailMoveQueue>()!);
4547
// Register the background service
4648
services.AddHostedService<EmailMonitoringService>();
4749

0 commit comments

Comments
 (0)