private void AddFailureLog(CreateTask task, Exception ex) { var taskLog = new CreateTaskLog(0, task.CreateType, task.SiteId, task.ChannelId, task.ContentId, task.FileTemplateId, task.SpecialId, task.Name, string.Empty, false, ex.Message, DateTime.Now); lock (LockObject) { if (TaskLogs.Count > 20) { TaskLogs.RemoveAt(20); } TaskLogs.Insert(0, taskLog); } }
private void AddSuccessLog(CreateTask task, string timeSpan) { var taskLog = new CreateTaskLog(0, task.CreateType, task.SiteId, task.ChannelId, task.ContentId, task.FileTemplateId, task.SpecialId, task.Name, timeSpan, true, string.Empty, DateTime.Now); lock (LockObject) { if (TaskLogs.Count > 20) { TaskLogs.RemoveAt(20); } TaskLogs.Insert(0, taskLog); } }