private async Task PublishContentToAllSites(
string contentPath,
string siteReplicatorPath)
{
// Publish to all the target sites in parallel
var allChanges = await Task.WhenAll(Instance.Repository.Sites.Select(async site =>
{
return await PublishContentToSingleSite(site);
}));
// Trace all the results
for (int i = 0; i < allChanges.Length; i++)
{
DeploymentChangeSummary changeSummary = allChanges[i];
if (changeSummary == null) continue;
Trace.TraceInformation("Processed sites: {0}", Instance.Repository.Sites.Count());
Trace.TraceInformation("BytesCopied: {0}", changeSummary.BytesCopied);
Trace.TraceInformation("Added: {0}", changeSummary.ObjectsAdded);
Trace.TraceInformation("Updated: {0}", changeSummary.ObjectsUpdated);
Trace.TraceInformation("Deleted: {0}", changeSummary.ObjectsDeleted);
Trace.TraceInformation("Errors: {0}", changeSummary.Errors);
Trace.TraceInformation("Warnings: {0}", changeSummary.Warnings);
Trace.TraceInformation("Total changes: {0}", changeSummary.TotalChanges);
}
}