public async Task VacancyStatusAsync([QueueTrigger(QueueNames.VacancyStatusQueueName, Connection = "QueueStorage")] string message, TextWriter log) { if (_jobsConfig.DisabledJobs.Contains(JobName)) { _logger.LogDebug($"{JobName} is disabled, skipping ..."); return; } _logger.LogInformation("Starting vacancy status checking."); try { await _client.CloseExpiredVacancies(); _logger.LogInformation("Finished vacancy status checking."); } catch (Exception ex) { _logger.LogError(ex, "Unable to check vacancy statuses."); throw; } }
public async Task Run([TimerTrigger(Schedules.MidnightDaily, RunOnStartup = CanRunOnStartup)] TimerInfo timerInfo, TextWriter log) { if (_jobsConfig.DisabledJobs.Contains(this.GetType().Name)) { _logger.LogDebug($"{this.GetType().Name} is disabled, skipping ..."); return; } _logger.LogInformation("Starting vacancy status checking."); try { await _client.CloseExpiredVacancies(); _logger.LogInformation("Finished vacancy status checking."); } catch (Exception ex) { _logger.LogError(ex, "Unable to check vacancy statuses."); throw; } }