Skip to content

Commit 41e31a1

Browse files
committed
Why 15 seconds and why even the CTS
1 parent 84dfb71 commit 41e31a1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ServiceControl.Infrastructure/Watchdog.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ public Task Start(Action onFailedOnStartup, CancellationToken cancellationToken)
5353
{
5454
try
5555
{
56+
// Host builder start is launching the loop. The watch dog loop task runs in isolation
57+
// We want the start not to run to infinity. An NServiceBus endpoint should easily
58+
// start within 15 seconds.
59+
const int MaxStartDurationMs = 15000;
5660
using var cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(shutdownTokenSource.Token);
57-
cancellationTokenSource.CancelAfter(15000);
61+
cancellationTokenSource.CancelAfter(MaxStartDurationMs);
5862

5963
log.Debug($"Ensuring {taskName} is running");
6064
await ensureStarted(cancellationTokenSource.Token).ConfigureAwait(false);

0 commit comments

Comments
 (0)