public UpsertCandidateJob( IEnv env, ICrmService crm, INotifyService notifyService, IPerformContextAdapter contextAdapter, IMetricService metrics, ILogger <UpsertCandidateJob> logger) : base(env) { _crm = crm; _notifyService = notifyService; _contextAdapter = contextAdapter; _metrics = metrics; _logger = logger; }
protected string AttemptInfo(PerformContext context, IPerformContextAdapter adapter) { return($"{CurrentAttempt(context, adapter)}/{JobConfiguration.Attempts(Env)}"); }
protected int CurrentAttempt(PerformContext context, IPerformContextAdapter adapter) { return(adapter.GetRetryCount(context) + 1); }
protected bool IsLastAttempt(PerformContext context, IPerformContextAdapter adapter) { var currentAttempt = CurrentAttempt(context, adapter); return(currentAttempt >= JobConfiguration.Attempts(Env)); }