Exemplo n.º 1
0
        public override async Task <SchedulerResponse> StartJob(Job request, ServerCallContext context)
        {
            var jobEntity = Utils.MapperGrpcJob <Job, JobEntity>(request);
            var result    = await _schedulerManager.StartJob(jobEntity);

            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);
                }
            });
        }