/// <summary> /// Configuration of the Heartbeat functionality /// </summary> public LiteServerConfiguration Heartbeat(Action <HeartbeatConfiguration> heartbeat) { if (heartbeat == null) { throw new ArgumentNullException(nameof(heartbeat)); } HeartbeatConfiguration instance = null; Application.Extensibility(extensibility => { instance = extensibility.Register(() => new HeartbeatConfiguration(this, _configuration)); }); heartbeat.Invoke(instance); return(this); }
internal HeartbeatLoggingConfiguration(HeartbeatConfiguration heartbeat, InternalConfiguration configuration) { if (heartbeat == null) { throw new ArgumentNullException(nameof(heartbeat)); } if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } _configuration = configuration; Heartbeat = heartbeat; // Default is logging every 5th minute Interval(TimeSpan.FromMinutes(5)); // Default repository Repository <ConfigurationServiceBasedHeartbeatLoggingRepository>(); }
public HeartbeatService(HeartbeatConfiguration configuration) { _configuration = configuration; _timer = new Timer(Heartbeat, null, TimeSpan.Zero, TimeSpan.FromMilliseconds(_configuration.Interval)); }