Ejemplo n.º 1
0
        private void RevokeJob(Guid jobKey)
        {
            var revokedJob = _jobInProgress.RevokeJob(jobKey);

            if (revokedJob != null)
            {
                Agent.DebugMessage(msg: $"Revoking Job from Processing {revokedJob.Job.Name} {revokedJob.Job.Key}", CustomLogger.JOB, LogLevel.Warn);
                Agent.Send(instruction: Job.Instruction.AcknowledgeRevoke.Create(message: Agent.Context.Self, target: revokedJob.JobAgentRef));
                UpdateProcessingItem();
                return;
            }

            var jobConfirmation = _scopeQueue.GetConfirmation(jobKey);

            if (jobConfirmation != null)
            {
                Agent.DebugMessage(msg: $"Revoking Job from ScopeQueue {jobConfirmation.Job.Name} {jobConfirmation.Job.Key}", CustomLogger.JOB, LogLevel.Warn);
                _scopeQueue.RemoveJob(jobConfirmation);
                UpdateAndRequeuePlanedJobs(jobConfirmation);
                Agent.Send(instruction: Job.Instruction.AcknowledgeRevoke.Create(message: Agent.Context.Self, target: jobConfirmation.JobAgentRef));
                return;
            }
            Agent.DebugMessage(msg: $"Job could not be Revoked {jobKey} its already gone.", CustomLogger.JOB, LogLevel.Warn);
        }