File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed
src/main/java/console/command Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change 23
23
import java .util .Set ;
24
24
import org .fisco .bcos .sdk .v3 .client .Client ;
25
25
import org .fisco .bcos .sdk .v3 .client .protocol .response .BcosGroupInfo ;
26
+ import org .fisco .bcos .sdk .v3 .client .protocol .response .BcosGroupInfoList ;
26
27
import org .fisco .bcos .sdk .v3 .contract .precompiled .sysconfig .SystemConfigFeature ;
27
28
import org .fisco .bcos .sdk .v3 .contract .precompiled .sysconfig .SystemConfigService ;
28
29
import org .fisco .bcos .sdk .v3 .model .EnumNodeVersion ;
@@ -201,16 +202,22 @@ private static List<Completer> generateComplters(Client client) {
201
202
keys .add (feature .toString ());
202
203
}
203
204
}
204
- Optional <BcosGroupInfo .GroupInfo > group =
205
- client .getGroupInfoList ()
206
- .getResult ()
207
- .stream ()
208
- .filter (groupInfo -> groupInfo .getGroupID ().equals (client .getGroup ()))
209
- .findFirst ();
210
- if (group .isPresent () && !group .get ().getNodeList ().isEmpty ()) {
211
- group .get ()
212
- .getNodeList ()
213
- .forEach (groupNodeInfo -> keys .addAll (groupNodeInfo .getFeatureKeys ()));
205
+ BcosGroupInfoList groupInfoList ;
206
+ try {
207
+ groupInfoList = client .getGroupInfoList ();
208
+ Optional <BcosGroupInfo .GroupInfo > group =
209
+ groupInfoList
210
+ .getResult ()
211
+ .stream ()
212
+ .filter (groupInfo -> groupInfo .getGroupID ().equals (client .getGroup ()))
213
+ .findFirst ();
214
+ if (group .isPresent () && !group .get ().getNodeList ().isEmpty ()) {
215
+ group .get ()
216
+ .getNodeList ()
217
+ .forEach (groupNodeInfo -> keys .addAll (groupNodeInfo .getFeatureKeys ()));
218
+ }
219
+ } catch (Exception ignored ) {
220
+ logger .info ("Failed to get group info list, skip feature keys." );
214
221
}
215
222
216
223
for (String command : commands ) {
You can’t perform that action at this time.
0 commit comments