public async Task StopAsync(CancellationToken cancellationToken) { _logger.LogInformation("Stopping metric service"); await _server.StopAsync(); _server.Dispose(); }
protected virtual void Dispose(bool disposing) { if (!_disposedValue) { if (disposing) { _collector?.Dispose(); _server.Stop(); _server.Dispose(); } _disposedValue = true; } }
public void Dispose() { _server?.Dispose(); }