Fix logic for result (#1113)

* commented subscription caching

* added additional code path if user.UniqueId not set

* fixed failing unit tests

* updated logic
This commit is contained in:
Christopher Suh
2020-11-02 09:44:30 -05:00
committed by GitHub
parent 271a0f5733
commit d94e691b07

View File

@@ -225,7 +225,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl
if (user.UniqueId != "") {
result = _subscriptionCache.Get(user.UniqueId);
}
if (result == null) {
if (result == Enumerable.Empty<IAzureUserAccountSubscriptionContext>() ^ result == null) {
result = await GetSubscriptionFromServiceAsync(user);
_subscriptionCache.UpdateCache(user.UniqueId, result);
}