Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in BuildConnectionString Method #521

Open
panditem opened this issue Dec 30, 2024 · 1 comment
Open

Bug in BuildConnectionString Method #521

panditem opened this issue Dec 30, 2024 · 1 comment

Comments

@panditem
Copy link

The BuildConnectionString method in the RedisClientPool class has a bug when constructing the connection string. In line 117, a comma is missing before the user parameter, causing a runtime error. I fixed this issue locally by adding the necessary comma, resolving the bug.

ORIGINAL CODE

internal string BuildConnectionString(string endpoint)
{
return $"{endpoint}{(string.IsNullOrEmpty(_user) ? "" : $"user={_user}")},password={_password},defaultDatabase={_database},poolsize={PoolSize}," +
$"connectTimeout={_connectTimeout},syncTimeout={_syncTimeout},idletimeout={(int)IdleTimeout.TotalMilliseconds}," +
$"preheat=false,ssl={(_ssl ? "true" : "false")},tryit={_tryit},name={_clientname},prefix={Prefix}," +
$"autodispose={(IsAutoDisposeWithSystem ? "true" : "false")},asyncpipeline={(_asyncPipeline ? "true" : "false")}";
}

FIXED CODE
Connection Error

internal string BuildConnectionString(string endpoint)
{
return $"{endpoint}{(string.IsNullOrEmpty(_user) ? "" : $",user={_user}")},password={_password},defaultDatabase={_database},poolsize={PoolSize}," +
$"connectTimeout={_connectTimeout},syncTimeout={_syncTimeout},idletimeout={(int)IdleTimeout.TotalMilliseconds}," +
$"preheat=false,ssl={(_ssl ? "true" : "false")},tryit={_tryit},name={_clientname},prefix={Prefix}," +
$"autodispose={(IsAutoDisposeWithSystem ? "true" : "false")},asyncpipeline={(_asyncPipeline ? "true" : "false")}";
}

@2881099
Copy link
Owner

2881099 commented Dec 31, 2024

Invite to use FreeRedis: https://github.com/2881099/FreeRedis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants