File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -1227,7 +1227,15 @@ func (m *Manager) DeleteCommunityTokenPermission(request *requests.DeleteCommuni
12271227}
12281228
12291229func (m * Manager ) reevaluateCommunityMembersPermissions (communityID types.HexBytes ) error {
1230+ // Publish when the reevluation started since it can take a while
1231+ signal .SendCommunityMemberReevaluationStarted (types .EncodeHex (communityID ))
1232+
12301233 community , newPrivilegedMembers , err := m .ReevaluateMembers (communityID )
1234+
1235+ // Publish the reevaluation ending, even if it errored
1236+ // A possible improvement would be to pass the error here
1237+ signal .SendCommunityMemberReevaluationEnded (types .EncodeHex (communityID ))
1238+
12311239 if err != nil {
12321240 return err
12331241 }
Original file line number Diff line number Diff line change 1+ package signal
2+
3+ const (
4+ MemberReevaluationStatus = "community.memberReevaluationStatus"
5+ )
6+
7+ type ReevaluationStatus uint
8+
9+ const (
10+ None ReevaluationStatus = iota
11+ InProgress
12+ Done
13+ )
14+
15+ type CommunityMemberReevaluationSignal struct {
16+ CommunityID string `json:"communityId"`
17+ Status ReevaluationStatus `json:"status"`
18+ }
19+
20+ func SendCommunityMemberReevaluationStarted (communityID string ) {
21+ send (MemberReevaluationStatus , CommunityMemberReevaluationSignal {CommunityID : communityID , Status : InProgress })
22+ }
23+
24+ func SendCommunityMemberReevaluationEnded (communityID string ) {
25+ send (MemberReevaluationStatus , CommunityMemberReevaluationSignal {CommunityID : communityID , Status : Done })
26+ }
You can’t perform that action at this time.
0 commit comments