mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-19 09:42:29 +08:00
Shaving off a few microseconds per content item import.
This commit is contained in:
@@ -98,13 +98,14 @@ namespace Orchard.Recipes.Providers.Executors {
|
|||||||
var nextIdentity = importContentSession.GetNextInBatch();
|
var nextIdentity = importContentSession.GetNextInBatch();
|
||||||
while (nextIdentity != null) {
|
while (nextIdentity != null) {
|
||||||
var itemId = "";
|
var itemId = "";
|
||||||
if (elementDictionary[nextIdentity.ToString()].HasAttributes) {
|
var nextIdentityValue = nextIdentity.ToString();
|
||||||
itemId = elementDictionary[nextIdentity.ToString()].FirstAttribute.Value;
|
if (elementDictionary[nextIdentityValue].HasAttributes) {
|
||||||
|
itemId = elementDictionary[nextIdentityValue].FirstAttribute.Value;
|
||||||
}
|
}
|
||||||
Logger.Information("Importing data item '{0}' (item {1}/{2}).", itemId, itemIndex + 1, elementDictionary.Count);
|
Logger.Information("Importing data item '{0}' (item {1}/{2}).", itemId, itemIndex + 1, elementDictionary.Count);
|
||||||
try {
|
try {
|
||||||
_orchardServices.ContentManager.Import(
|
_orchardServices.ContentManager.Import(
|
||||||
elementDictionary[nextIdentity.ToString()],
|
elementDictionary[nextIdentityValue],
|
||||||
importContentSession);
|
importContentSession);
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
|
|||||||
Reference in New Issue
Block a user