Skip to content

Commit a614527

Browse files
authored
Merge pull request #200 from hufeng/v3.0.0
remove _agentAddrSet
2 parents 641346c + 3b711b3 commit a614527

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

packages/dubbo/src/registry/zookeeper.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
IDubboRegistryProps,
3232
IZkClientProps,
3333
} from '../types';
34-
import {eqSet, isDevEnv, msg, traceErr} from '../util';
34+
import {isDevEnv, msg, traceErr} from '../util';
3535
import Registry from './registry';
3636

3737
const log = debug('dubbo:zookeeper');
@@ -44,15 +44,12 @@ export class ZkRegistry extends Registry<IZkClientProps & IDubboRegistryProps> {
4444
log(`new:|> %O`, props);
4545
//默认dubbo
4646
this._props.zkRoot = this._props.zkRoot || 'dubbo';
47-
//初始化agentAddrSet
48-
this._agentAddrSet = new Set();
4947
//初始化zookeeper的client
5048
this._connect(this._init);
5149
}
5250

5351
private _checkTimer: NodeJS.Timer;
5452
private _client: zookeeper.Client;
55-
private _agentAddrSet: Set<string>;
5653

5754
//========================private method==========================
5855
private _init = async (err: Error) => {
@@ -104,7 +101,6 @@ export class ZkRegistry extends Registry<IZkClientProps & IDubboRegistryProps> {
104101
log('dubboServiceUrl:|> %O', this._dubboServiceUrlMap);
105102
}
106103

107-
this._agentAddrSet = this._allAgentAddrSet;
108104
this._subscriber.onData(this._allAgentAddrSet);
109105
};
110106

@@ -281,12 +277,7 @@ export class ZkRegistry extends Registry<IZkClientProps & IDubboRegistryProps> {
281277
);
282278
}
283279

284-
if (!eqSet(this._agentAddrSet, this._allAgentAddrSet)) {
285-
this._agentAddrSet = this._allAgentAddrSet;
286-
this._subscriber.onData(this._allAgentAddrSet);
287-
} else {
288-
log('no agent change');
289-
}
280+
this._subscriber.onData(this._allAgentAddrSet);
290281
};
291282
}
292283

0 commit comments

Comments
 (0)