Skip to content

Commit

Permalink
Fix ListAsync method of Redis store
Browse files Browse the repository at this point in the history
  • Loading branch information
sfmskywalker committed Aug 28, 2023
1 parent 8d3670e commit 3d147cd
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class RedisClusterMemberStore : IClusterMemberStore
private readonly IRedisConnectionMultiplexerProvider _connectionMultiplexerProvider;
private readonly ISystemClock _systemClock;
private const string ClusterKey = "proto:cluster:members";
private IDatabase _database;
[CanBeNull] private IDatabase _database;

/// <summary>
/// Initializes a new instance of the <see cref="RedisClusterMemberStore"/> class.
Expand All @@ -33,7 +33,8 @@ public RedisClusterMemberStore(IRedisConnectionMultiplexerProvider connectionMul
/// <inheritdoc />
public async ValueTask<ICollection<StoredMember>> ListAsync(CancellationToken cancellationToken = default)
{
var entries = await _database.HashGetAllAsync(ClusterKey);
var database = await GetDatabaseAsync();
var entries = await database.HashGetAllAsync(ClusterKey);
return entries.Select(entry => Deserialize(entry.Value!)).ToList();
}

Expand Down

0 comments on commit 3d147cd

Please sign in to comment.