File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
src/Caching/StackExchangeRedis/src Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -292,14 +292,23 @@ private void ValidateServerFeatures()
292
292
{
293
293
_ = _connection ?? throw new InvalidOperationException ( $ "{ nameof ( _connection ) } cannot be null.") ;
294
294
295
- foreach ( var endPoint in _connection . GetEndPoints ( ) )
295
+ try
296
296
{
297
- if ( _connection . GetServer ( endPoint ) . Version < ServerVersionWithExtendedSetCommand )
297
+ foreach ( var endPoint in _connection . GetEndPoints ( ) )
298
298
{
299
- _setScript = SetScriptPreExtendedSetCommand ;
300
- return ;
299
+ if ( _connection . GetServer ( endPoint ) . Version < ServerVersionWithExtendedSetCommand )
300
+ {
301
+ _setScript = SetScriptPreExtendedSetCommand ;
302
+ return ;
303
+ }
301
304
}
302
305
}
306
+ catch ( NotSupportedException )
307
+ {
308
+ // The GetServer call may not be supported with some configurations, in which
309
+ // case let's also fall back to using the older command.
310
+ _setScript = SetScriptPreExtendedSetCommand ;
311
+ }
303
312
}
304
313
305
314
private void TryRegisterProfiler ( )
You can’t perform that action at this time.
0 commit comments