зеркало из https://github.com/microsoft/BuildXL.git
Merged PR 788364: Address issue with shutdown sequence in AzureBlobStorageLog
This commit is contained in:
Родитель
8e9c7529b5
Коммит
5914404e99
|
@ -287,6 +287,23 @@ namespace BuildXL.Cache.Logging.External
|
|||
{
|
||||
#pragma warning disable CA1031 // Do not catch general exception types
|
||||
#pragma warning disable ERP022 // Unobserved exception in generic exception handler
|
||||
try
|
||||
{
|
||||
Flush();
|
||||
LogManager.Shutdown();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
try
|
||||
{
|
||||
_host.Error(exception, "Failed to dispose NLog instance");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// We just don't want to interrupt the Dispose sequence
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_log.ShutdownAsync().GetAwaiter().GetResult().ThrowIfFailure();
|
||||
|
@ -303,23 +320,6 @@ namespace BuildXL.Cache.Logging.External
|
|||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Flush();
|
||||
NLog.LogManager.Shutdown();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
try
|
||||
{
|
||||
_host.Error(exception, "Failed to dispose NLog instance");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// We just don't want to interrupt the Dispose sequence
|
||||
}
|
||||
}
|
||||
#pragma warning restore ERP022 // Unobserved exception in generic exception handler
|
||||
#pragma warning restore CA1031 // Do not catch general exception types
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче