adjustments for grpc service client
This commit is contained in:
@@ -52,10 +52,26 @@ public class MareConfigurationServiceClient<T> : IConfigurationService<T> where
|
|||||||
|
|
||||||
if (!isCurrent)
|
if (!isCurrent)
|
||||||
{
|
{
|
||||||
var result = GetValueFromGrpc(key, defaultValue, prop.PropertyType);
|
try
|
||||||
if (result == null) return defaultValue;
|
{
|
||||||
_cachedRemoteProperties[key] = result;
|
var result = GetValueFromGrpc(key, defaultValue, prop.PropertyType);
|
||||||
return (T1)_cachedRemoteProperties[key].Value;
|
if (result == null) return defaultValue;
|
||||||
|
_cachedRemoteProperties[key] = result;
|
||||||
|
return (T1)_cachedRemoteProperties[key].Value;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (existingEntry != null)
|
||||||
|
{
|
||||||
|
_logger.LogWarning(ex, "Could not get value for {key} from Grpc, returning existing", key);
|
||||||
|
return (T1)existingEntry.Value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.LogWarning(ex, "Could not get value for {key} from Grpc, returning default", key);
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user