Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Wait for Windows Diagnostics to wake up
static void WaitForWindowsAzureDiagnosticsInfrastructureToCatchUp()
{
// According to http://l.tath.am/k6uPrK, the diagnostics infrastructure takes a
// few seconds to start. If a crash occurs during this time, we'd never be
// able to find out why.
// We also need to do this at the /end/ of the role. Even if we explicitly flush
// the trace, it'll still lose the last few messages if we exit too quickly.
Thread.Sleep(TimeSpan.FromSeconds(10));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment