@@ -22,7 +22,6 @@ namespace Microsoft.Azure.Functions.PowerShellWorker.Durable
2222 /// </summary>
2323 internal class DurableController
2424 {
25- private readonly bool _durableEnabled ;
2625 private readonly DurableFunctionInfo _durableFunctionInfo ;
2726 private readonly IPowerShellServices _powerShellServices ;
2827 private readonly IOrchestrationInvoker _orchestrationInvoker ;
@@ -32,20 +31,17 @@ public DurableController(
3231 DurableFunctionInfo durableDurableFunctionInfo ,
3332 PowerShell pwsh )
3433 : this (
35- Utils . AreDurableFunctionsEnabled ( ) ,
3634 durableDurableFunctionInfo ,
3735 new PowerShellServices ( pwsh ) ,
3836 new OrchestrationInvoker ( ) )
3937 {
4038 }
4139
4240 internal DurableController (
43- bool durableEnabled ,
4441 DurableFunctionInfo durableDurableFunctionInfo ,
4542 IPowerShellServices powerShellServices ,
4643 IOrchestrationInvoker orchestrationInvoker )
4744 {
48- _durableEnabled = durableEnabled ;
4945 _durableFunctionInfo = durableDurableFunctionInfo ;
5046 _powerShellServices = powerShellServices ;
5147 _orchestrationInvoker = orchestrationInvoker ;
@@ -57,8 +53,6 @@ public void BeforeFunctionInvocation(IList<ParameterBinding> inputData)
5753 // in the module context for the 'Start-NewOrchestration' function to use.
5854 if ( _durableFunctionInfo . IsDurableClient )
5955 {
60- ThrowIfDurableNotEnabled ( ) ;
61-
6256 var durableClient =
6357 inputData . First ( item => item . Name == _durableFunctionInfo . DurableClientBindingName )
6458 . Data . ToObject ( ) ;
@@ -67,8 +61,6 @@ public void BeforeFunctionInvocation(IList<ParameterBinding> inputData)
6761 }
6862 else if ( _durableFunctionInfo . IsOrchestrationFunction )
6963 {
70- ThrowIfDurableNotEnabled ( ) ;
71-
7264 _orchestrationBindingInfo = CreateOrchestrationBindingInfo ( inputData ) ;
7365 _powerShellServices . SetOrchestrationContext ( _orchestrationBindingInfo . Context ) ;
7466 }
@@ -96,7 +88,7 @@ public bool TryGetInputBindingParameterValue(string bindingName, out object valu
9688 public void AddPipelineOutputIfNecessary ( Collection < object > pipelineItems , Hashtable result )
9789 {
9890 var shouldAddPipelineOutput =
99- _durableEnabled && _durableFunctionInfo . Type == DurableFunctionType . ActivityFunction ;
91+ _durableFunctionInfo . Type == DurableFunctionType . ActivityFunction ;
10092
10193 if ( shouldAddPipelineOutput )
10294 {
@@ -131,13 +123,5 @@ private static OrchestrationBindingInfo CreateOrchestrationBindingInfo(IList<Par
131123 context . Name ,
132124 JsonConvert . DeserializeObject < OrchestrationContext > ( context . Data . String ) ) ;
133125 }
134-
135- private void ThrowIfDurableNotEnabled ( )
136- {
137- if ( ! _durableEnabled )
138- {
139- throw new NotImplementedException ( PowerShellWorkerStrings . DurableFunctionsDisabled ) ;
140- }
141- }
142126 }
143127}
0 commit comments