Refactored all synchronizers to deal with some of the chronic issues.
This commit is contained in:
@@ -1,11 +1,22 @@
|
||||
using System.Threading.Tasks;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Models.Errors;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Synchronizers.Errors.Gmail;
|
||||
|
||||
namespace Wino.Core.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Factory for handling Gmail synchronizer errors.
|
||||
/// Registers and routes errors to appropriate handlers.
|
||||
/// </summary>
|
||||
public class GmailSynchronizerErrorHandlingFactory : SynchronizerErrorHandlingFactory, IGmailSynchronizerErrorHandlerFactory
|
||||
{
|
||||
public bool CanHandle(SynchronizerErrorContext error) => CanHandle(error);
|
||||
|
||||
public Task HandleAsync(SynchronizerErrorContext error) => HandleErrorAsync(error);
|
||||
public GmailSynchronizerErrorHandlingFactory(
|
||||
GmailQuotaExceededHandler quotaExceededHandler,
|
||||
GmailRateLimitHandler rateLimitHandler,
|
||||
GmailHistoryExpiredHandler historyExpiredHandler)
|
||||
{
|
||||
// Order matters - more specific handlers should be registered first
|
||||
RegisterHandler(quotaExceededHandler);
|
||||
RegisterHandler(historyExpiredHandler);
|
||||
RegisterHandler(rateLimitHandler); // Most generic rate limit handler last
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user