A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/StackExchange/StackExchange.Redis/issues/1460 below:

DefaultDatabase ignored for initial connection · Issue #1460 · StackExchange/StackExchange.Redis · GitHub

I'm calling ConnectionMultiplexer.Connect like so:

var options = new ConfigurationOptions
{
    EndPoints = {"endpoint"},
    DefaultDatabase = 10,
};

var connectionMultiplexer = ConnectionMultiplexer.Connect(options);

// ...

When later calling connectionMultiplexer.GetDatabase(), the DefaultDatabase is respected correctly for any following operations.

However, the initial connection when calling ConnectionMultiplexer.Connect is still made to db number 0, only switching over to 10 after GetDatabase is called. This is not ideal, as we have multiple applications connecting to Redis on different dbs, and seeing applications connecting to db 0, which they're not supposed to use, even if it's just for the time until the first operations run, is confusing.

How can I avoid this? I would've expected DefaultDatabase to be the setting to set this, but it's not working as expected.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4