示例#1
0
        public void Updates_LastStatusMessageTime_on_StatusMessage()
        {
            var node = new NodeInfo(3, "test", new string[0]);

            A.CallTo(() => store.GetById(node.Id)).Returns(node);

            tracker.Handle(new StatusMessage {
                Id = node.Id
            });

            node.LastStatusMessageTime.ShouldBe(CurrentDate);
        }
 private bool IsMergeRequest(Solutions message)
 {
     if (message.SolutionsList.Length > 0 && message.SolutionsList.All(s => s.Type == SolutionType.Partial))
     {
         var id   = message.SolutionsList[0].NodeID;
         var node = nodeStore.GetById(id);
         return(node?.Type == Constants.NodeTypes.TaskManager);
     }
     return(false);
 }
示例#3
0
        public void Handle(StatusMessage notification)
        {
            logger.Debug($"Updating lastseen time for node {notification.Id}.");
            var node = csDataStore.GetById(notification.Id);

            if (node != null)
            {
                node.LastStatusMessageTime = timeProvider.Now();
            }
        }
示例#4
0
        public IMessage GetWorkForNode(ulong nodeId)
        {
            var node = nodeStore.GetById(nodeId);

            if (node != null)
            {
                if (node.Type == Constants.NodeTypes.ComputationalNode)
                {
                    return(GetWorkForComputationalNode(node));
                }
                else if (node.Type == Constants.NodeTypes.TaskManager)
                {
                    return(GetWorkForTaskManager(node));
                }
            }
            return(null);
        }