Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 61463a2

Browse files
committed
Change parsing of ServerVersion
1 parent 6ee2a42 commit 61463a2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/ServiceStack.Redis/RedisNativeClient_Utils.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,14 @@ private void Connect()
9090
{
9191
if (ServerVersionNumber == 0)
9292
{
93-
ServerVersionNumber = int.Parse(ServerVersion.Replace(".", "").PadRight(4, '0'));
93+
var parts = ServerVersion.Split('.');
94+
var version = int.Parse(parts[0]) * 1000;
95+
if (parts.Length > 1)
96+
version += int.Parse(parts[1])*100;
97+
if (parts.Length > 2)
98+
version += int.Parse(parts[2]);
99+
100+
ServerVersionNumber = version;
94101
}
95102
}
96103
catch {}

0 commit comments

Comments
 (0)