Skip to content

Commit 0904b9c

Browse files
committed
Commenting Task.Delay(5000)
1 parent 3c33fde commit 0904b9c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

articles/azure-monitor/app/console.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,12 @@ namespace ConsoleApp
169169
// before exit, flush the remaining data
170170
telemetryClient.Flush();
171171

172-
// Flush() is synchronous when using InMemoryChannel; otherwise a short delay is required.
173-
// Task.Delay(5000).Wait();
172+
// As noted at the beginning of this article, Console apps should use the WorkerService package.
173+
// WorkerService uses ServerTelemetryChannel and does not have synchronous flushing.
174+
175+
Task.Delay(5000).Wait();
176+
177+
// Flush() is synchronous when using InMemoryChannel, in which case the short delay is not required.
174178
175179
}
176180

0 commit comments

Comments
 (0)