public async Task <List <JobAnalysis> > ListJobAnalysis() { using (var client = _arangoConnection.CreateClient()) { var results = await client.Query <JobAnalysis>().ToListAsync(); return(results.Select(r => new JobAnalysis() { _key = r._key, Title = r.Title }).ToList()); } }
public async Task SearchAllAnalysis() { string timeStamp = DateTime.Now.ToString("yyyyMMddHHmmss"); using (var client = _arangoConnection.CreateClient()) { var jobs = await client.Query <JobAnalysis>().ToListAsync(); foreach (var job in jobs) { bool success = false; int retry = 0; while (!success && retry < _searchOptions.MaxRetry) { try { retry++; await Search(job, client, timeStamp); success = true; } catch (Exception ex) { _logger.Error(ex, $"search {job.Title}. {retry} of {_searchOptions.MaxRetry} attempts."); } } } } }