File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
src/Worker.Extensions.DurableTask Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 66
77### Bug Fixes
88
9+ - Check if function invocation already has an executor before registering durable executor. (#3265 )
10+
911### Breaking Changes
1012
1113### Dependency Updates
Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ internal class DurableTaskFunctionsMiddleware(DurableFunctionExecutor invoker) :
1616 /// <inheritdoc />
1717 public Task Invoke ( FunctionContext functionContext , FunctionExecutionDelegate next )
1818 {
19- if ( functionContext . TryGetOrchestrationBinding ( out _ )
20- || functionContext . TryGetEntityBinding ( out _ )
21- || functionContext . TryGetActivityBinding ( out _ ) )
19+ // If the function is a Durable Task function and there is no executor registered yet,
20+ // register the Durable Function executor.
21+ if ( functionContext . Features . Get < IFunctionExecutor > ( ) is null && functionContext . IsDurableTaskFunction ( ) )
2222 {
2323 functionContext . Features . Set < IFunctionExecutor > ( invoker ) ;
2424 }
Original file line number Diff line number Diff line change @@ -11,6 +11,16 @@ namespace Microsoft.Azure.Functions.Worker.Extensions.DurableTask;
1111
1212internal static class FunctionContextExtensions
1313{
14+ /// <summary>
15+ /// Determines whether the function context represents a Durable Task function.
16+ /// </summary>
17+ /// <param name="context">The function context.</param>
18+ /// <returns>True if function is a durable task trigger, false otherwise.</returns>
19+ public static bool IsDurableTaskFunction ( this FunctionContext context )
20+ => context . TryGetOrchestrationBinding ( out _ )
21+ || context . TryGetActivityBinding ( out _ )
22+ || context . TryGetEntityBinding ( out _ ) ;
23+
1424 /// <summary>
1525 /// Tries to get the orchestration trigger binding from the function context.
1626 /// </summary>
You can’t perform that action at this time.
0 commit comments