Skip to content

Commit 223c7c4

Browse files
committed
changes based on review
1 parent 481db46 commit 223c7c4

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

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

-6
Original file line numberDiff line numberDiff line change
@@ -807,15 +807,9 @@ public async Task<GetTriggersResult> GetTriggersPayloadAsync()
807807

808808
PrepareSyncTriggers();
809809

810-
var hashBlobClient = await GetHashBlobAsync();
811-
812810
var payload = await GetSyncTriggersPayload();
813811
if (payload.Count == 0)
814812
{
815-
// We don't do background sync for empty triggers.
816-
// We've seen error cases where a site temporarily gets into a situation
817-
// where it's site content is empty. Doing the empty sync can cause the app
818-
// to go idle when it shouldn't.
819813
_logger.LogDebug("No functions found in GetTriggers operation.");
820814
}
821815

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ namespace Microsoft.Azure.WebJobs.Script.WebHost.Management
88
public class GetTriggersResult
99
{
1010
/// <summary>
11-
/// Gets or sets a value indicating whether the sync operation was successful.
11+
/// Gets or sets a value indicating whether the operation was successful.
1212
/// </summary>
1313
public bool Success { get; set; }
1414

1515
/// <summary>
16-
/// Gets or sets the error string in the case of a failed sync operation.
16+
/// Gets or sets the error string in the case of a failed operation.
1717
/// </summary>
1818
public string Error { get; set; }
1919

2020
/// <summary>
21-
/// Gets or sets the payload of the triggers.
21+
/// Gets or sets the triggers payload.
2222
/// </summary>
2323
public SyncTriggersPayload Payload { get; set; }
2424
}

test/WebJobs.Script.Tests.Integration/Management/FunctionsSyncManagerTests.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -257,18 +257,18 @@ private void ResetMockFileSystem(string hostJsonContent = null, string extension
257257
}
258258

259259
[Fact]
260-
public async Task GetSyncTriggersPayload_ExpectedContent()
260+
public async Task GetTriggersPayload_ExpectedContent()
261261
{
262262
// Act
263-
var syncResult = await _functionsSyncManager.GetTriggersPayloadAsync();
263+
var result = await _functionsSyncManager.GetTriggersPayloadAsync();
264264

265265
// Assert
266-
Assert.True(syncResult.Success);
267-
Assert.Null(syncResult.Error);
268-
Assert.NotNull(syncResult.Payload);
266+
Assert.True(result.Success);
267+
Assert.Null(result.Error);
268+
Assert.NotNull(result.Payload);
269269

270-
var result = JObject.Parse(syncResult.Payload.Content);
271-
var triggers = result["triggers"];
270+
var content = JObject.Parse(result.Payload.Content);
271+
var triggers = content["triggers"];
272272
Assert.Equal(GetExpectedTriggersPayload(durableVersion: "V1"), triggers.ToString(Formatting.None));
273273
}
274274

0 commit comments

Comments
 (0)