wanshenmean
12 小时以前 96adc295cb04fd135d63d3a907f2732274f90965
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/QuartzNet/SchedulerCenterServer.cs
@@ -86,7 +86,7 @@
            WebResponseContent result = new WebResponseContent();
            try
            {
                if (_scheduler.IsShutdown && _scheduler.IsStarted)
                if (_scheduler.IsShutdown || !_scheduler.IsStarted)
                {
                    // 从Factory中获取Scheduler实例
                    NameValueCollection collection = new NameValueCollection
@@ -110,7 +110,7 @@
                }
                else
                {
                    await _scheduler.Shutdown();
                    // 调度器已在运行,直接返回提示
                    result = WebResponseContent.Instance.Error(QuartzJobInfoMessage.JobHasStart);
                    return result;
                }
@@ -135,16 +135,13 @@
                    //等待任务运行完成
                    await _scheduler.Shutdown(false);
                    await Console.Out.WriteLineAsync(QuartzJobInfoMessage.StopJobSuccess);
                    QuartzLogger.Info(QuartzJobInfoMessage.StopJobSuccess);
                    result = WebResponseContent.Instance.OK(QuartzJobInfoMessage.StopJobSuccess);
                    return result;
                }
                else
                {
                    IReadOnlyCollection<string> jobGroupNames = await _scheduler.GetJobGroupNames();
                    await _scheduler.PauseAll();
                    // 调度器已停止,直接返回提示(不再对已 shutdown 的 scheduler 调用 PauseAll)
                    result = WebResponseContent.Instance.Error(QuartzJobInfoMessage.JobHasStop);
                    return result;
                }
@@ -169,7 +166,7 @@
            {
                try
                {
                    if (_scheduler.IsShutdown && _scheduler.IsStarted)
                    if (_scheduler.IsShutdown || !_scheduler.IsStarted)
                    {
                        // 从Factory中获取Scheduler实例
                        NameValueCollection collection = new NameValueCollection