Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions tools/test-proxy/Azure.Sdk.Tools.TestProxy/RecordingHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1093,14 +1093,21 @@ public void AddTransformToRecording(string recordingId, ResponseTransform transf
}


public void SetMatcherForRecording(string recordingId, RecordMatcher matcher)
public async Task SetMatcherForRecording(string recordingId, RecordMatcher matcher)
{
if (!PlaybackSessions.TryGetValue(recordingId, out var session))
{
throw new HttpException(HttpStatusCode.BadRequest, $"{recordingId} is not an active playback session. Check the value being passed and try again.");
}

session.CustomMatcher = matcher;
await session.Session.EntryLock.WaitAsync();
try {
session.CustomMatcher = matcher;
}
finally
{
session.Session.EntryLock.Release();
}
}

public async Task SetDefaultExtensions(string recordingId = null)
Expand Down
Loading