/// <summary> /// Updates the status when failure. /// </summary> /// <param name="service">Service.</param> /// <param name="error">Error.</param> /// <param name="exception">Exception.</param> public void UpdateStatusWhenFailure(DataSyncService service, string error, Exception exception) { service.Status = 2; service.RetryCount = service.RetryCount + 1; service.LastResult = error; service.LastRunTime = DateTime.Now; }
/// <summary> /// 执行完成后更新状态数据 /// </summary> /// <param name="service">Service.</param> /// <param name="message">Message.</param> public void UpdateStatusWhenSuccess(DataSyncService service, string message) { service.Status = 1; service.RetryCount = 0; service.LastResult = message; service.LastRunTime = DateTime.Now; service.NextRunTime = service.NextRunTime.AddMinutes(service.Interval); }