Skip to content

Commit

Permalink
Add some logs for group-info-updater-task to help troubleshooting.
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhaixian1984 committed Jun 21, 2024
1 parent 0bd223a commit 145d34a
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/tasks/group-info-updater-task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,18 @@ async function handleUpdate(context: AppContext, logger: Logger) {
}
}

validMembers.sort();
const nodeIndex = validMembers.indexOf(api.getChainAccount());
context.groupInfo = {
groupAccount: groupOwner,
totalMembers: validMembers.length,
nodeIndex,
};
if (validMembers.length > 0) {
logger.info(`load ${validMembers.length} valid group members`);
validMembers.sort();
const nodeIndex = validMembers.indexOf(api.getChainAccount());
context.groupInfo = {
groupAccount: groupOwner,
totalMembers: validMembers.length,
nodeIndex,
};
} else {
logger.warn(`load ${validMembers.length} valid group members`);
}
} catch (e) {
logger.error('failed updating group info: %s', formatError(e));
context.groupInfo = null;
Expand Down

0 comments on commit 145d34a

Please sign in to comment.