Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
a677bac4
Commit
a677bac4
authored
Mar 17, 2016
by
Marc Gravell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #375 from deepakverma/defaultversion
Set default version to 3.0 for Azure
parents
9825f67f
89a5b98a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+25
-9
Config.cs
MigratedBookSleeveTestSuite/Config.cs
+21
-7
ConfigurationOptions.cs
...xchange.Redis/StackExchange/Redis/ConfigurationOptions.cs
+2
-1
RedisFeatures.cs
StackExchange.Redis/StackExchange/Redis/RedisFeatures.cs
+2
-1
No files found.
MigratedBookSleeveTestSuite/Config.cs
View file @
a677bac4
...
...
@@ -188,45 +188,59 @@ public void CreateDisconnectedNonsenseConnection_DNS()
}
[
Test
]
public
void
AbortConnectFalse
ForAzure
()
public
void
ConfigurationOptionsDefault
ForAzure
()
{
var
options
=
ConfigurationOptions
.
Parse
(
"contoso.redis.cache.windows.net"
);
Assert
.
IsTrue
(
options
.
DefaultVersion
.
Equals
(
new
Version
(
3
,
0
,
0
)));
Assert
.
IsFalse
(
options
.
AbortOnConnectFail
);
}
[
Test
]
public
void
AbortConnectTrue
ForAzureWhenSpecified
()
public
void
ConfigurationOptions
ForAzureWhenSpecified
()
{
var
options
=
ConfigurationOptions
.
Parse
(
"contoso.redis.cache.windows.net,abortConnect=true"
);
var
options
=
ConfigurationOptions
.
Parse
(
"contoso.redis.cache.windows.net,abortConnect=true, version=2.1.1"
);
Assert
.
IsTrue
(
options
.
DefaultVersion
.
Equals
(
new
Version
(
2
,
1
,
1
)));
Assert
.
IsTrue
(
options
.
AbortOnConnectFail
);
}
[
Test
]
public
void
AbortConnectFalse
ForAzureChina
()
public
void
ConfigurationOptionsDefault
ForAzureChina
()
{
// added a few upper case chars to validate comparison
var
options
=
ConfigurationOptions
.
Parse
(
"contoso.REDIS.CACHE.chinacloudapi.cn"
);
Assert
.
IsTrue
(
options
.
DefaultVersion
.
Equals
(
new
Version
(
3
,
0
,
0
)));
Assert
.
IsFalse
(
options
.
AbortOnConnectFail
);
}
[
Test
]
public
void
AbortConnectFalseForAzureUSGov
()
public
void
ConfigurationOptionsDefaultForAzureGermany
()
{
var
options
=
ConfigurationOptions
.
Parse
(
"contoso.redis.cache.cloudapi.de"
);
Assert
.
IsTrue
(
options
.
DefaultVersion
.
Equals
(
new
Version
(
3
,
0
,
0
)));
Assert
.
IsFalse
(
options
.
AbortOnConnectFail
);
}
[
Test
]
public
void
ConfigurationOptionsDefaultForAzureUSGov
()
{
var
options
=
ConfigurationOptions
.
Parse
(
"contoso.redis.cache.usgovcloudapi.net"
);
Assert
.
IsTrue
(
options
.
DefaultVersion
.
Equals
(
new
Version
(
3
,
0
,
0
)));
Assert
.
IsFalse
(
options
.
AbortOnConnectFail
);
}
[
Test
]
public
void
AbortConnectTrue
ForNonAzure
()
public
void
ConfigurationOptionsDefault
ForNonAzure
()
{
var
options
=
ConfigurationOptions
.
Parse
(
"redis.contoso.com"
);
Assert
.
IsTrue
(
options
.
DefaultVersion
.
Equals
(
new
Version
(
2
,
0
,
0
)));
Assert
.
IsTrue
(
options
.
AbortOnConnectFail
);
}
[
Test
]
public
void
AbortConnect
DefaultWhenNoEndpointsSpecifiedYet
()
public
void
ConfigurationOptions
DefaultWhenNoEndpointsSpecifiedYet
()
{
var
options
=
new
ConfigurationOptions
();
Assert
.
IsTrue
(
options
.
DefaultVersion
.
Equals
(
new
Version
(
2
,
0
,
0
)));
Assert
.
IsTrue
(
options
.
AbortOnConnectFail
);
}
...
...
StackExchange.Redis/StackExchange/Redis/ConfigurationOptions.cs
View file @
a677bac4
...
...
@@ -210,7 +210,7 @@ public CommandMap CommandMap
/// <summary>
/// The server version to assume
/// </summary>
public
Version
DefaultVersion
{
get
{
return
defaultVersion
??
RedisFeatures
.
v2_0_0
;
}
set
{
defaultVersion
=
value
;
}
}
public
Version
DefaultVersion
{
get
{
return
defaultVersion
??
(
IsAzureEndpoint
()
?
RedisFeatures
.
v3_0_0
:
RedisFeatures
.
v2_0_0
)
;
}
set
{
defaultVersion
=
value
;
}
}
/// <summary>
/// The endpoints defined for this configuration
...
...
@@ -656,6 +656,7 @@ private bool IsAzureEndpoint()
case
".redis.cache.windows.net"
:
case
".redis.cache.chinacloudapi.cn"
:
case
".redis.cache.usgovcloudapi.net"
:
case
".redis.cache.cloudapi.de"
:
return
true
;
}
}
...
...
StackExchange.Redis/StackExchange/Redis/RedisFeatures.cs
View file @
a677bac4
...
...
@@ -26,7 +26,8 @@ public struct RedisFeatures
v2_8_0
=
new
Version
(
2
,
8
,
0
),
v2_8_12
=
new
Version
(
2
,
8
,
12
),
v2_8_18
=
new
Version
(
2
,
8
,
18
),
v2_9_5
=
new
Version
(
2
,
9
,
5
);
v2_9_5
=
new
Version
(
2
,
9
,
5
),
v3_0_0
=
new
Version
(
3
,
0
,
0
);
private
readonly
Version
version
;
/// <summary>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment