Skip to content

Commit 9a83a04

Browse files
committed
address pr feedbacks
1 parent dbc7154 commit 9a83a04

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Service/GroupMembershipManagement/Hosts/WebApi/Services.WebApi/GetDefaultSqlMembershipSourceAttributeValuesHandler.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ public class GetDefaultSqlMembershipSourceAttributeValuesHandler : RequestHandle
1717
private readonly IDataFactoryRepository _dataFactoryRepository;
1818
private readonly ISqlMembershipRepository _sqlMembershipRepository;
1919

20-
private SemaphoreSlim _adfRunIdSemaphore = new SemaphoreSlim(1, 1);
21-
2220
public GetDefaultSqlMembershipSourceAttributeValuesHandler(ILoggingRepository loggingRepository,
2321
IDataFactoryRepository dataFactoryRepository,
2422
ISqlMembershipRepository sqlMembershipRepository) : base(loggingRepository)
@@ -33,7 +31,7 @@ protected override async Task<GetDefaultSqlMembershipSourceAttributeValuesRespon
3331
try
3432
{
3533
var response = new GetDefaultSqlMembershipSourceAttributeValuesResponse();
36-
var attributeValues = await GetSqlAttributeValues(request.Attribute);
34+
var attributeValues = await GetSqlAttributeValuesAsync(request.Attribute);
3735
foreach (var attributeValue in attributeValues)
3836
{
3937
var dto = new SqlMembershipAttributeValueDTO(attributeValue.Code, attributeValue.Description);
@@ -49,7 +47,7 @@ protected override async Task<GetDefaultSqlMembershipSourceAttributeValuesRespon
4947
}
5048
}
5149

52-
private async Task<List<(string Code, string Description)>> GetSqlAttributeValues(string attribute)
50+
private async Task<List<(string Code, string Description)>> GetSqlAttributeValuesAsync(string attribute)
5351
{
5452
var tableName = await GetTableNameAsync();
5553
var attributes = await GetAttributeValuesAsync(attribute, tableName);
@@ -101,12 +99,8 @@ private async Task<bool> CheckIfMappingsTableExistsAsync(string tableName)
10199

102100
private async Task<string> GetADFRunIdAsync()
103101
{
104-
await _adfRunIdSemaphore.WaitAsync();
105-
106102
var lastSqlMembershipRunId = await _dataFactoryRepository.GetMostRecentSucceededRunIdAsync();
107103

108-
_adfRunIdSemaphore.Release();
109-
110104
if (string.IsNullOrWhiteSpace(lastSqlMembershipRunId))
111105
{
112106
var message = $"No SqlMembershipObtainer pipeline run has been found";

0 commit comments

Comments
 (0)