This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,13 @@ public partial class RedisNativeClient
30
30
private const string OK = "OK" ;
31
31
private const string QUEUED = "QUEUED" ;
32
32
private static Timer UsageTimer ;
33
+
33
34
private static int __requestsPerHour = 0 ;
35
+ public static int RequestsPerHour
36
+ {
37
+ get { return __requestsPerHour ; }
38
+ }
39
+
34
40
private const int Unknown = - 1 ;
35
41
public int ServerVersionNumber { get ; set ; }
36
42
@@ -146,14 +152,18 @@ private void Connect()
146
152
{
147
153
if ( ServerVersionNumber == 0 )
148
154
{
149
- var parts = ServerVersion . Split ( '.' ) ;
150
- var version = int . Parse ( parts [ 0 ] ) * 1000 ;
151
- if ( parts . Length > 1 )
152
- version += int . Parse ( parts [ 1 ] ) * 100 ;
153
- if ( parts . Length > 2 )
154
- version += int . Parse ( parts [ 2 ] ) ;
155
-
156
- ServerVersionNumber = version ;
155
+ ServerVersionNumber = RedisConfig . AssumeServerVersion . GetValueOrDefault ( 0 ) ;
156
+ if ( ServerVersionNumber <= 0 )
157
+ {
158
+ var parts = ServerVersion . Split ( '.' ) ;
159
+ var version = int . Parse ( parts [ 0 ] ) * 1000 ;
160
+ if ( parts . Length > 1 )
161
+ version += int . Parse ( parts [ 1 ] ) * 100 ;
162
+ if ( parts . Length > 2 )
163
+ version += int . Parse ( parts [ 2 ] ) ;
164
+
165
+ ServerVersionNumber = version ;
166
+ }
157
167
}
158
168
}
159
169
catch ( Exception )
You can’t perform that action at this time.
0 commit comments