Skip to content

Commit 5cb04e7

Browse files
authored
Register extension startup hooks only once (#2816)
* Register extension startup hooks only once * Minor comment update
1 parent 76f0ea7 commit 5cb04e7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/DotNetWorker.Core/Hosting/ServiceCollectionExtensions.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@ public static IFunctionsWorkerApplicationBuilder AddFunctionsWorkerCore(this ISe
110110
{
111111
builder = new FunctionsWorkerApplicationBuilder(services);
112112
services.AddSingleton<IFunctionsWorkerApplicationBuilder>(builder);
113-
}
114113

115-
// Execute startup code from worker extensions if present.
116-
RunExtensionStartupCode(builder);
114+
// Execute startup code from worker extensions if present
115+
// Only run this once when builder is first added.
116+
RunExtensionStartupCode(builder);
117+
}
117118

118119
return builder;
119120
}

0 commit comments

Comments
 (0)