File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,12 @@ func (m *MutableGroupManager) Close() {
6565 m .removalQueue .close ()
6666}
6767
68- func (m * MutableGroupManager ) Groups () []adapter.MutableOutboundGroup {
68+ func (m * MutableGroupManager ) OutboundGroup (tag string ) (adapter.MutableOutboundGroup , bool ) {
69+ group , found := m .groups [tag ]
70+ return group , found
71+ }
72+
73+ func (m * MutableGroupManager ) OutboundGroups () []adapter.MutableOutboundGroup {
6974 m .mu .Lock ()
7075 defer m .mu .Unlock ()
7176 return slices .Collect (maps .Values (m .groups ))
@@ -151,8 +156,15 @@ func (m *MutableGroupManager) RemoveFromGroup(group, tag string) error {
151156 return fmt .Errorf ("failed to remove %s from %s: %w" , tag , group , err )
152157 }
153158
154- _ , isEndpoint := m .endpointMgr .Get (tag )
155- m .removalQueue .enqueue (tag , isEndpoint )
159+ outbound , exists := m .outboundMgr .Outbound (tag )
160+ if ! exists {
161+ return nil
162+ }
163+ // we don't want to delete outbound groups themselves
164+ if _ , isOutboundGroup := outbound .(A.OutboundGroup ); ! isOutboundGroup {
165+ _ , isEndpoint := m .endpointMgr .Get (tag )
166+ m .removalQueue .enqueue (tag , isEndpoint )
167+ }
156168 return nil
157169}
158170
You can’t perform that action at this time.
0 commit comments