| | |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Caches; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_Core.LogHelper; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine("调度服务开启异常" + ex.ToString()); |
| | | QuartzLogger.Error($"调度服务开启异常", "QuartzNetExtension", ex); |
| | | } |
| | | } |
| | | else |
| | |
| | | _ => targetDevice.Device |
| | | }; |
| | | WebResponseContent responseContent = await _schedulerCenter.AddScheduleJobAsync(dispatches[i]); |
| | | if (responseContent.Status) ConsoleHelper.WriteSuccessLine(dispatches[i].Name + "调度服务添加成功"); else ConsoleHelper.WriteErrorLine(dispatches[i].Name + "调度服务添加失败"); |
| | | if (responseContent.Status) |
| | | { |
| | | QuartzLogger.Info($"{dispatches[i].Name}调度服务添加成功", "QuartzNetExtension"); |
| | | ConsoleHelper.WriteSuccessLine(dispatches[i].Name + "调度服务添加成功"); |
| | | } |
| | | else |
| | | { |
| | | QuartzLogger.Error($"{dispatches[i].Name}调度服务添加失败", "QuartzNetExtension"); |
| | | ConsoleHelper.WriteErrorLine(dispatches[i].Name + "调度服务添加失败"); |
| | | } |
| | | } |
| | | //await _schedulerCenter.StartScheduleAsync(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine("调度服务开启异常" + ex.ToString()); |
| | | QuartzLogger.Error($"调度服务开启异常", "QuartzNetExtension", ex); |
| | | throw; |
| | | } |
| | | } |