Example #1
0
        public override async Task <SchedulerResponse> PauseJob(Job request, ServerCallContext context)
        {
            var result = await _schedulerManager.PauseJob(request.Id);

            return(new SchedulerResponse()
            {
                Success = result
            });
        }
        private void RecoveryRunning()
        {
            //绑定本节点且在运行中或已暂停的任务
            var jobs = _jobStore.QueryRunningJob(Config.NodeHost, Config.NodePort);

            jobs.AsParallel().ForAll(async job =>
            {
                await _schedulerManager.StartJob(job);
                if (job.Status == (int)JobStatus.Paused)
                {
                    await _schedulerManager.PauseJob(job.Id);
                }
            });
        }