You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at your logic about group deletion, you first find out all the child ids in a recursive way and delete them together. If there is a loop, it will SOF. you also didn't check when you added the group.A good approach is to remove the parent group before querying the child id
The text was updated successfully, but these errors were encountered:
func getAllChildId(ctx *context.Context, rootId int) []int {
var ids []id
var ret []int
db.Instance.Select(&ids, db.WithContext(ctx, "select id from group where parent_id=? and user_id=?"), rootId, ctx.UserID)
for _, item := range ids {
ret = array.Merge(ret, getAllChildId(ctx, item.Id))
ret = append(ret, item.Id)
}
return ret
}
Looking at your logic about group deletion, you first find out all the child ids in a recursive way and delete them together. If there is a loop, it will SOF. you also didn't check when you added the group.A good approach is to remove the parent group before querying the child id
The text was updated successfully, but these errors were encountered: