Skip to content

Commit

Permalink
updated blob endpoint again
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Conway <richard@elastacloud.com>
  • Loading branch information
azurecoder committed Jan 5, 2013
1 parent 4d374cc commit 1ba866d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Elastacloud.AzureManagement.Storage.Blob/app.config
Expand Up @@ -3,4 +3,11 @@
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<system.diagnostics>
<trace autoflush="false" indentsize="4">
<listeners>
<add name="configConsoleListener" type="System.Diagnostics.ConsoleTraceListener" />
</listeners>
</trace>
</system.diagnostics>
</configuration>
6 changes: 5 additions & 1 deletion Elastacloud.AzureManagement.Storage/BlobEndpoint.cs
Expand Up @@ -48,20 +48,24 @@ public int CopyBlobTo(BlobEndpoint destinationEndpoint)
if (!EndpointState.Force)
{
if (AreBlobsIdentical(destinationEndpoint))
{
System.Diagnostics.Trace.TraceWarning("Skipping: {0}", sourceBlob.Uri.AbsoluteUri);
return 0;
}
}
// copy from the destination blob pulling the blob
try
{
destinationBlob.StartCopyFromBlob(new Uri(sourceBlob.Uri.AbsoluteUri + signature));
System.Diagnostics.Trace.TraceInformation("Copying: {0}", destinationEndpoint.EndpointState.BlobName);
}
catch (Exception ex)
{
var we = ex.InnerException as WebException;
if (we != null && we.Status == WebExceptionStatus.ProtocolError)
{
// TODO: replace this with a tracelistener
Console.WriteLine("conflict with blob copy for blob {0} - you currently have a pending blob already waiting to be copied", sourceBlob.Uri.AbsoluteUri);
System.Diagnostics.Trace.TraceError("conflict with blob copy for blob {0} - you currently have a pending blob already waiting to be copied", sourceBlob.Uri.AbsoluteUri);
return 0;
}
}
Expand Down

0 comments on commit 1ba866d

Please sign in to comment.