http://git.fedorahosted.org/git/?p=spacewalk.git;a=commitdiff;h=f811e59d177e6922c54eea65123d9782b324bac7
Can we move the second lookup to inside of the if? That way, since most
times the family will not be null we remove the duplicate load from the
normal case.
ChannelFamily family =
ChannelFamilyFactory.lookupByOrg(user.getOrg());
if (family == null) {
// In most scenarios, the channel family will not be null.
Changes
// were made to ensure that the family is created at org
creation (486018)
// as well as during satellite-sync (446289); however,
there is still
// an edge case where a customer may have an earlier
Satellite (e.g. 511)
// with a configuration that doesn't have a channel family
created yet,
// they upgrade to the version that has these improvements
(e.g. 530) and
// then attempt to clone a channel (e.g. using API). In
that case,
// it is possible the family doesn't yet exist when this
method is called.
OrgManager.createChannelFamily(user.getOrg());
}
family = ChannelFamilyFactory.lookupByOrg(user.getOrg());
--
Jason Dobies
RHN Satellite / Spacewalk
RHCE# 805008743336126
Freenode: jdob @ #spacewalk #spacewalk-devel
_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel