Skip to content

Commit

Permalink
BE-713 Fix an issue to fail detecting newly added channel (#59)
Browse files Browse the repository at this point in the history
Added check to see if new channel is found.

Signed-off-by: Atsushi Neki <atsushin@fast.au.fujitsu.com>
  • Loading branch information
nekia authored and nfrunza committed Nov 30, 2019
1 parent 5b8ec0b commit 621a12a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/platform/fabric/sync/SyncService.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ class SyncServices {
*/
async synchNetworkConfigToDB(client) {
const channels = client.getChannels();
const channels_query = await client.hfc_client.queryChannels(
client.defaultPeer,
true
);
for (const channel of channels_query.channels) {
const channel_name = channel.channel_id;
if (!channels.get(channel_name)) {
await client.initializeNewChannel(channel_name);
}
}

for (const [channel_name, channel] of channels.entries()) {
console.log(
'SyncServices.synchNetworkConfigToDB client ',
Expand Down

0 comments on commit 621a12a

Please sign in to comment.