For #30311 Refactored `AddHostsToTeam` so that batch size can be specified via a parameter and not a global variable.