public void Info(object message) { if (message == null) { return; } _sitecoreLog.Info(message); _unicornLogger.Info(message.ToString()); }
protected virtual void LoadItems(IConfiguration[] configurations, DataBlasterParameters parameters, ILogger logger) { var databaseNames = configurations .SelectMany(c => c.Resolve <PredicateRootPathResolver>().GetRootPaths().Select(rp => rp.DatabaseName)) .Distinct(); foreach (var databaseName in databaseNames) { logger.Info($"Syncing database '{databaseName}'..."); var context = CreateBulkLoadContext(BulkLoader, databaseName, configurations, parameters, logger); var bulkItems = ItemExtractor.ExtractBulkItems(context, configurations, databaseName); BulkLoader.LoadItems(context, bulkItems); if (context.AnyStageFailed) { throw new Exception($"Stage failed during bulkload of database '{databaseName}': {context.FailureMessage}"); } // Support publishing after sync. if (!IsUnicornPublishEnabled && !databaseName.Equals("core", StringComparison.OrdinalIgnoreCase)) { foreach (var itemChange in context.ItemChanges) { ManualPublishQueueHandler.AddItemToPublish(itemChange.ItemId); } } } }