Skip to content

Commit 73459f4

Browse files
MB-47110: actually update maybeGetServersWithGroups stream each 10 sec
Change-Id: I42af8908c1a8e38d92ed2cfc06314f9d2d10d4c1 Reviewed-on: https://review.couchbase.org/c/ns_server/+/165837 Well-Formed: Build Bot <[email protected]> Reviewed-by: Pavel Blagodov <[email protected]> Tested-by: Pavel Blagodov <[email protected]>
1 parent afd4c07 commit 73459f4

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

priv/public/ui/app/mn.server.groups.service.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,16 @@ class MnServerGroupsService {
4949

5050
let serverGroupsReadStream =
5151
permissionsStream.pipe(pluck('cluster','server_groups','read'),
52-
distinctUntilChanged())
52+
distinctUntilChanged());
5353

5454
this.stream.maybeGetServersWithGroups =
55-
combineLatest([mnAdminService.stream.isGroupsAvailable,
56-
serverGroupsReadStream])
57-
.pipe(switchMap(([isGroupsAvailable, serverGroupsRead]) => {
58-
let maybeWithGroups =
59-
isGroupsAvailable && serverGroupsRead ?
60-
nodesWithGroupName : mnAdminService.stream.getNodes;
61-
return combineLatest([
62-
timer(0, 10000),
63-
maybeWithGroups
64-
]);
55+
combineLatest(mnAdminService.stream.isGroupsAvailable,
56+
serverGroupsReadStream,
57+
timer(0, 10000))
58+
.pipe(switchMap(([isGroupsAvailable, serverGroupsRead,]) => {
59+
let hasGroups = isGroupsAvailable && serverGroupsRead;
60+
return hasGroups ? nodesWithGroupName : mnAdminService.stream.getNodes;
6561
}),
66-
pluck(1),
6762
shareReplay({refCount: true, bufferSize: 1}));
6863
}
6964

0 commit comments

Comments
 (0)