Skip to content

Commit 590e14a

Browse files
committed
Making TryDeleteFunction async #5641
1 parent bd350f3 commit 590e14a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/WebJobs.Script.WebHost/Controllers/FunctionsController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public async Task<IActionResult> Delete(string name)
167167
return NotFound();
168168
}
169169

170-
(var deleted, var error) = _functionsManager.TryDeleteFunction(function);
170+
(var deleted, var error) = await _functionsManager.TryDeleteFunction(function);
171171

172172
if (deleted)
173173
{

src/WebJobs.Script.WebHost/Management/IWebFunctionsManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ public interface IWebFunctionsManager
1616

1717
Task<(bool, bool, FunctionMetadataResponse)> CreateOrUpdate(string name, FunctionMetadataResponse functionMetadata, HttpRequest request);
1818

19-
(bool, string) TryDeleteFunction(FunctionMetadataResponse function);
19+
Task<(bool, string)> TryDeleteFunction(FunctionMetadataResponse function);
2020
}
2121
}

src/WebJobs.Script.WebHost/Management/WebFunctionsManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ await functionMetadata
184184
/// </summary>
185185
/// <param name="function">Function to be deleted</param>
186186
/// <returns>(success, errorMessage)</returns>
187-
public (bool, string) TryDeleteFunction(FunctionMetadataResponse function)
187+
public async Task<(bool, string)> TryDeleteFunction(FunctionMetadataResponse function)
188188
{
189189
try
190190
{
@@ -197,7 +197,7 @@ await functionMetadata
197197

198198
DeleteFunctionArtifacts(function);
199199

200-
_functionsSyncManager.TrySyncTriggersAsync();
200+
await _functionsSyncManager.TrySyncTriggersAsync();
201201

202202
return (true, string.Empty);
203203
}

0 commit comments

Comments
 (0)