You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by hu...@apache.org on 2020/01/11 15:03:58 UTC

[dubbo-js] branch v3.0.0 updated: remove _agentAddrSet

This is an automated email from the ASF dual-hosted git repository.

hufeng pushed a commit to branch v3.0.0
in repository https://gitbox.apache.org/repos/asf/dubbo-js.git


The following commit(s) were added to refs/heads/v3.0.0 by this push:
     new 3b711b3  remove _agentAddrSet
     new a614527  Merge pull request #200 from hufeng/v3.0.0
3b711b3 is described below

commit 3b711b3a2db1dfb4828018ec971016027140f559
Author: hufeng <fe...@gmail.com>
AuthorDate: Sat Jan 11 22:58:56 2020 +0800

    remove _agentAddrSet
---
 packages/dubbo/src/registry/zookeeper.ts | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/packages/dubbo/src/registry/zookeeper.ts b/packages/dubbo/src/registry/zookeeper.ts
index 1a03927..d5f98e1 100644
--- a/packages/dubbo/src/registry/zookeeper.ts
+++ b/packages/dubbo/src/registry/zookeeper.ts
@@ -31,7 +31,7 @@ import {
   IDubboRegistryProps,
   IZkClientProps,
 } from '../types';
-import {eqSet, isDevEnv, msg, traceErr} from '../util';
+import {isDevEnv, msg, traceErr} from '../util';
 import Registry from './registry';
 
 const log = debug('dubbo:zookeeper');
@@ -44,15 +44,12 @@ export class ZkRegistry extends Registry<IZkClientProps & IDubboRegistryProps> {
     log(`new:|> %O`, props);
     //默认dubbo
     this._props.zkRoot = this._props.zkRoot || 'dubbo';
-    //初始化agentAddrSet
-    this._agentAddrSet = new Set();
     //初始化zookeeper的client
     this._connect(this._init);
   }
 
   private _checkTimer: NodeJS.Timer;
   private _client: zookeeper.Client;
-  private _agentAddrSet: Set<string>;
 
   //========================private method==========================
   private _init = async (err: Error) => {
@@ -104,7 +101,6 @@ export class ZkRegistry extends Registry<IZkClientProps & IDubboRegistryProps> {
       log('dubboServiceUrl:|> %O', this._dubboServiceUrlMap);
     }
 
-    this._agentAddrSet = this._allAgentAddrSet;
     this._subscriber.onData(this._allAgentAddrSet);
   };
 
@@ -281,12 +277,7 @@ export class ZkRegistry extends Registry<IZkClientProps & IDubboRegistryProps> {
         );
       }
 
-      if (!eqSet(this._agentAddrSet, this._allAgentAddrSet)) {
-        this._agentAddrSet = this._allAgentAddrSet;
-        this._subscriber.onData(this._allAgentAddrSet);
-      } else {
-        log('no agent change');
-      }
+      this._subscriber.onData(this._allAgentAddrSet);
     };
   }