I have recently upgraded to Commerce 13.30.0 and ever since our scheduled job that imports products is running incredibly slow. Before the update it would run in minutes. Now it will take hours.
This scheduled job pulls in products from an external REST service on our end.
I have narrowed it down to the "_associationRepository.RemoveAssociation(association)" call of the following function:
public async Task<List<Association>> Import(IServiceLayerApi serviceLayerApi, KitContent kitContent) { var bomInfo = await GetBomInformationRecursive(serviceLayerApi, kitContent.Code);
var associations = bomInfo .Select(x => CreateAssociation(kitContent.ContentLink, x)) .Where(x => x != null) .ToList();
var existing = _associationRepository.GetAssociations(kitContent.ContentLink).ToArray(); foreach (var association in existing) { _associationRepository.RemoveAssociation(association); } _associationRepository.UpdateAssociations(associations);
return associations; }
When i remove the foreach loop with the RemoveAssociation call the scheduled job goes back to taking only a minute.
Is there something that changed from Commerce 13.29 to 13.30 that would cause this slow down?
I have recently upgraded to Commerce 13.30.0 and ever since our scheduled job that imports products is running incredibly slow. Before the update it would run in minutes. Now it will take hours.
This scheduled job pulls in products from an external REST service on our end.
I have narrowed it down to the "_associationRepository.RemoveAssociation(association)" call of the following function:
public async Task<List<Association>> Import(IServiceLayerApi serviceLayerApi, KitContent kitContent)
{
var bomInfo = await GetBomInformationRecursive(serviceLayerApi, kitContent.Code);
var associations = bomInfo
.Select(x => CreateAssociation(kitContent.ContentLink, x))
.Where(x => x != null)
.ToList();
var existing = _associationRepository.GetAssociations(kitContent.ContentLink).ToArray();
foreach (var association in existing)
{
_associationRepository.RemoveAssociation(association);
}
_associationRepository.UpdateAssociations(associations);
return associations;
}
When i remove the foreach loop with the RemoveAssociation call the scheduled job goes back to taking only a minute.
Is there something that changed from Commerce 13.29 to 13.30 that would cause this slow down?
Thank you,
Calvin