public Task RecordAsync(JobKey job, JobLogModel model) { var key = $"{job.Group}_{job.Name}"; if (!JobLog.ContainsKey(key)) { JobLog[key] = new FixLengthQueue(QUEUE_LENGTH); } JobLog[key].Enqueue(model); return(Task.CompletedTask); }
public ActionResult Log(int id, string startTime, string endTime, int pageIndex = 1) { JobLogModel model = new JobLogModel() { JobId = id }; if (!string.IsNullOrWhiteSpace(startTime)) { model.StartTime = DateTime.Parse(startTime); model.EndTime = DateTime.Parse(endTime); } JobExecuteLogLogic logLogic = new JobExecuteLogLogic(); PageItem pageItem = new PageItem { PageIndex = pageIndex, PageSize = 15 }; List <JobExecuteLog> list = logLogic.GetJobExecuteLogList(model.JobId, model.StartTime, model.EndTime, pageItem).ToList <JobExecuteLog>(); PagedList <JobExecuteLog> pageList = new PagedList <JobExecuteLog>(list, pageItem.PageIndex, pageItem.PageSize, pageItem.TotalCount); ViewBag.DataSource = new PagedList <JobExecuteLog>(list, pageItem.PageIndex, pageItem.PageSize, pageItem.TotalCount); return(View(model)); }