Skip to content

Commit 4dbc927

Browse files
committed
fix: if the config key changes, re-listen
1 parent 7664d2d commit 4dbc927

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Nacos/V2/Config/Impl/ConfigRpcTransportClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ protected async override Task ExecuteConfigListen()
334334
{
335335
var listenCachesMap = new Dictionary<string, List<CacheData>>();
336336
var removeListenCachesMap = new Dictionary<string, List<CacheData>>();
337+
var hasChangedKeys = false;
337338

338339
// TODO: should update logic here.....
339340
foreach (var item in _cacheMap.Values)
@@ -392,6 +393,7 @@ protected async override Task ExecuteConfigListen()
392393

393394
if (configChangeBatchListenResponse.ChangedConfigs != null && configChangeBatchListenResponse.ChangedConfigs.Any())
394395
{
396+
hasChangedKeys = true;
395397
foreach (var item in configChangeBatchListenResponse.ChangedConfigs)
396398
{
397399
var changeKey = GroupKey.GetKeyTenant(item.DataId, item.Group, item.Tenant);
@@ -450,6 +452,9 @@ protected async override Task ExecuteConfigListen()
450452
}
451453
}
452454
}
455+
456+
if (hasChangedKeys)
457+
await NotifyListenConfig().ConfigureAwait(false);
453458
}
454459

455460
private async Task RefreshContentAndCheck(string groupKey, bool notify)

0 commit comments

Comments
 (0)