Ejemplo n.º 1
0
        private static bool?HostHasHeartbeat(IHeartbeatValidityMonitor heartbeatMonitor, int?expirationInSeconds,
                                             string containerName, string directoryName)
        {
            if (!expirationInSeconds.HasValue)
            {
                return(null);
            }

            return(heartbeatMonitor.IsSharedHeartbeatValid(containerName, directoryName, expirationInSeconds.Value));
        }
Ejemplo n.º 2
0
        private bool?HostHasHeartbeat(string sharedContainerName, string sharedDirectoryName, int expirationInSeconds)
        {
            string hostId = sharedContainerName + "/" + sharedDirectoryName;

            if (_cachedHostHeartbeats.ContainsKey(hostId))
            {
                return(_cachedHostHeartbeats[hostId]);
            }
            else
            {
                bool?heartbeat = _heartbeatMonitor.IsSharedHeartbeatValid(sharedContainerName, sharedDirectoryName,
                                                                          expirationInSeconds);
                _cachedHostHeartbeats.AddOrUpdate(hostId, heartbeat, (ignore1, ignore2) => heartbeat);
                return(heartbeat);
            }
        }
        private static bool? HostHasHeartbeat(IHeartbeatValidityMonitor heartbeatMonitor, int? expirationInSeconds,
            string containerName, string directoryName)
        {
            if (!expirationInSeconds.HasValue)
            {
                return null;
            }

            return heartbeatMonitor.IsSharedHeartbeatValid(containerName, directoryName, expirationInSeconds.Value);
        }