Skip to content

Commit bfedd10

Browse files
committed
Remove Disabled Filter from SyncTriggers (#4483)
1 parent 8c6de57 commit bfedd10

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

src/WebJobs.Script.WebHost/Extensions/FunctionMetadataExtensions.cs

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,29 +70,25 @@ public static async Task<FunctionMetadataResponse> ToFunctionMetadataResponse(th
7070
/// <returns>JObject that represent the trigger for scale controller to consume</returns>
7171
public static async Task<JObject> ToFunctionTrigger(this FunctionMetadata functionMetadata, ScriptJobHostOptions config)
7272
{
73-
// Only look at the function if it's not disabled
74-
if (!functionMetadata.IsDisabled)
75-
{
76-
// Get function.json path
77-
var functionPath = Path.Combine(config.RootScriptPath, functionMetadata.Name);
78-
var functionMetadataFilePath = Path.Combine(functionPath, ScriptConstants.FunctionMetadataFileName);
73+
// Get function.json path
74+
var functionPath = Path.Combine(config.RootScriptPath, functionMetadata.Name);
75+
var functionMetadataFilePath = Path.Combine(functionPath, ScriptConstants.FunctionMetadataFileName);
7976

80-
// Read function.json as a JObject
81-
var functionConfig = await GetFunctionConfig(functionMetadataFilePath);
77+
// Read function.json as a JObject
78+
var functionConfig = await GetFunctionConfig(functionMetadataFilePath);
8279

83-
// Find the trigger and add functionName to it
84-
foreach (JObject binding in (JArray)functionConfig["bindings"])
80+
// Find the trigger and add functionName to it
81+
foreach (JObject binding in (JArray)functionConfig["bindings"])
82+
{
83+
var type = (string)binding["type"];
84+
if (type.EndsWith("Trigger", StringComparison.OrdinalIgnoreCase))
8585
{
86-
var type = (string)binding["type"];
87-
if (type.EndsWith("Trigger", StringComparison.OrdinalIgnoreCase))
88-
{
89-
binding.Add("functionName", functionMetadata.Name);
90-
return binding;
91-
}
86+
binding.Add("functionName", functionMetadata.Name);
87+
return binding;
9288
}
9389
}
9490

95-
// If the function is disabled or has no trigger return null
91+
// If the function has no trigger return null
9692
return null;
9793
}
9894

0 commit comments

Comments
 (0)