Skip to content

Instantly share code, notes, and snippets.

@Romiko
Created February 7, 2012 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Romiko/1757083 to your computer and use it in GitHub Desktop.
Save Romiko/1757083 to your computer and use it in GitHub Desktop.
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