예제 #1
0
        public async Task Register(AgentRecord agentRecord, CancellationToken token = default)
        {
            agentRecord.VerifyNotNull(nameof(agentRecord));
            _logger.LogTrace($"{nameof(Register)}: agentId={agentRecord.Id}, state={agentRecord.State}");

            await _agentContainer.Set(agentRecord, token : token);
        }
예제 #2
0
        public static bool IsAgentRunning(this AgentRecord agentRecord, TimeSpan offlineTolerance)
        {
            agentRecord.VerifyNotNull(nameof(agentRecord));

            return(agentRecord.State == AgentState.Running &&
                   DateTime.UtcNow - agentRecord.UtcHeartbeat <= offlineTolerance);
        }