Open rburnham52 opened 7 years ago
I've just done some more tests, we also use the CreateFromFolder method which has a similar implementation.
public IAsset UploadFolder(string assetDirectory)
{
try
{
IAsset inputAsset = _context.Assets.CreateFromFolder(assetDirectory, AssetCreationOptions.CommonEncryptionProtected,
(af, p) =>
{
_logger.Information("Uploading '{0}' - Progress: {1:0.##}%", af.Name, p.Progress);
});
_logger.Information("Asset {0} created.", inputAsset.Id);
return inputAsset;
}
catch (Exception exception)
{
// Parse the XML error message in the Media Services response and create a new
// exception with its content.
exception = MediaServicesExceptionParser.Parse(exception);
_logger.Error(exception, exception.Message);
throw exception;
}
return null;
}
When using this method the Progress changed event is correctly fired and the progress is logged. It seems to be specifically when using the CreateFromFile method that the progress is not reported correctly. Am i doing something wrong?
Hi, Over the past few days i have been writing a console app to help us migrate some assets to azure. Initially i'm pretty sure i had the implementation receiving progress changed events which i was then logging the status. But in the past day or so i have noticed a bit of a problem. When i call the following function to create an asset and upload a file it hangs on _context.Assets.CreateFromFile for several minutes (current test it has been hanging for 10 mins). Then suddenly it fires the on progress changed event but the progress is 100%.
This is the code i am using. I am logging using Serilog but i tried just outputting to the console just in case but this had no effect.
The file it was attempting to upload was only 30MB but the process took around 12mins to complete. I've check that the asset was created and the file uploaded correctly. I'm not sure why i am only receiving progress changed events once it is complete.