RequeueJobsThatDidNotFinishedByWorkerNodeUri() public method

public RequeueJobsThatDidNotFinishedByWorkerNodeUri ( Uri workerNodeUri ) : void
workerNodeUri System.Uri
return void
Beispiel #1
0
        public void CheckWorkerNodesAreAlive(TimeSpan timeSpan)
        {
            var deadNodes = _workerNodeRepository.CheckNodesAreAlive(timeSpan);

            if (!deadNodes.Any())
            {
                return;
            }

            foreach (var node in deadNodes)
            {
                _nodeManager.RequeueJobsThatDidNotFinishedByWorkerNodeUri(node);
            }
        }
        public IHttpActionResult NodeInitialized([FromBody] Uri workerNodeUri)
        {
            var isValidRequest = _validator.ValidateUri(workerNodeUri);

            if (!isValidRequest.Success)
            {
                return(BadRequest(isValidRequest.Message));
            }

            this.Log().InfoWithLineNumber(WhoAmI(Request) + ": Received init from Node. Node Uri : ( " + workerNodeUri + " )");

            _nodeManager.RequeueJobsThatDidNotFinishedByWorkerNodeUri(workerNodeUri.ToString());
            _nodeManager.AddWorkerNode(workerNodeUri);
            return(Ok());
        }