File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/appservice/serviceplan Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1616import com .microsoft .azure .toolkit .intellij .common .AzureComboBox ;
1717import com .microsoft .azure .toolkit .intellij .common .Draft ;
1818import com .microsoft .azure .toolkit .lib .appservice .DraftServicePlan ;
19+ import com .microsoft .azure .toolkit .lib .common .cache .CacheManager ;
1920import com .microsoft .azure .toolkit .lib .common .model .Region ;
2021import com .microsoft .azure .toolkit .lib .common .model .Subscription ;
2122import com .microsoft .azure .toolkit .lib .common .operation .AzureOperation ;
2829import java .util .ArrayList ;
2930import java .util .List ;
3031import java .util .Objects ;
32+ import java .util .concurrent .ExecutionException ;
3133import java .util .function .Predicate ;
3234import java .util .stream .Collectors ;
3335import java .util .stream .Stream ;
@@ -55,8 +57,13 @@ public void setSubscription(Subscription subscription) {
5557 this .clear ();
5658 return ;
5759 }
58- // force refresh service plan when switch subscription
59- Azure .az (AzureAppService .class ).subscription (subscription .getId ()).appServicePlans (true );
60+ // Clean up app service plan cache when switch subscription
61+ // todo: leverage event hub to update resource cache automatically
62+ try {
63+ CacheManager .evictCache ("appservcie/{}/plans" , subscription .getId ());
64+ } catch (ExecutionException e ) {
65+ // swallow exception while clean up cache
66+ }
6067 this .refreshItems ();
6168 }
6269
You can’t perform that action at this time.
0 commit comments