public override async Task <ActivityExecutionResult> ExecuteAsync(WorkflowExecutionContext workflowContext, ActivityContext activityContext) { try { await _leverPostingService.GetFromAPICreateUpdate(); return(Outcomes(OutcomeDone)); } catch (Exception e) { _logger.LogError(e.Message, e); return(Outcomes(OutcomeFailed)); } }
public async Task DoWorkAsync(IServiceProvider serviceProvider, CancellationToken cancellationToken) { _logger.LogInformation($"Lever Background Task: Getting posts from Lever API"); try { await _leverPostingService.GetFromAPICreateUpdate(); } catch (Exception e) { _logger.LogError(e.Message, e); } _logger.LogInformation($"Lever Background Task: Completed getting posts from Lever API"); }