Skip to content

Commit

Permalink
Merge pull request #592 from bcgov/yj
Browse files Browse the repository at this point in the history
chore: performance
  • Loading branch information
ychung-mot committed Aug 30, 2024
2 parents 1b415a3 + fd25d0c commit 0203b2f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion helm/main/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ global:
role: f4a30d-prod
subPath: strdss-prod
env:
'Serilog__MinimumLevel__Override__StrDss__Common__StrDssLogger': 'Information'
'Serilog__MinimumLevel__Override__StrDss': 'Information'
'ASPNETCORE_ENVIRONMENT': 'Production'
'ENV_NAME': 'prod'
'APP_BASE_URL': 'https://strdata.gov.bc.ca'
Expand Down
2 changes: 1 addition & 1 deletion helm/main/values-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ global:
role: f4a30d-nonprod
subPath: strdss-test
env:
'Serilog__MinimumLevel__Override__StrDss__Common__StrDssLogger': 'Information'
'Serilog__MinimumLevel__Override__StrDss': 'Information'
'ASPNETCORE_ENVIRONMENT': 'Test'
'ENV_NAME': 'test'
'APP_BASE_URL': 'https://test.strdata.gov.bc.ca'
Expand Down
2 changes: 1 addition & 1 deletion helm/main/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ global:
role: f4a30d-nonprod
subPath: strdss-uat
env:
'Serilog__MinimumLevel__Override__StrDss__Common__StrDssLogger': 'Information'
'Serilog__MinimumLevel__Override__StrDss': 'Information'
'ASPNETCORE_ENVIRONMENT': 'Staging'
'ENV_NAME': 'uat'
'APP_BASE_URL': 'https://uat.strdata.gov.bc.ca'
Expand Down
13 changes: 9 additions & 4 deletions server/StrDss.Data/Repositories/RentalListingRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,19 @@ await _dbSet.AsNoTracking()

stopwatch.Restart();

var contacts = _mapper.Map<List<RentalListingContactDto>>(await _dbContext.DssRentalListingContacts
.AsNoTracking()
.Where(contact => listings
.Select(listing => listing.RentalListingId)
.Contains(contact.ContactedThroughRentalListingId))
.ToListAsync());

foreach (var listing in listings)
{
await SetExtraProperties(listing);

listing.LastActionDtm = listing.LastActionDtm == null ? null : DateUtils.ConvertUtcToPacificTime(listing.LastActionDtm.Value);
listing.Filtered = filteredIdSet.Contains(listing.RentalListingId ?? 0);

listing.Hosts = contacts.Where(x => x.ContactedThroughRentalListingId == listing.RentalListingId).ToList();
group.NightsBookedYtdQty += listing.NightsBookedYtdQty ?? 0;

}

stopwatch.Stop();
Expand Down

0 comments on commit 0203b2f

Please sign in to comment.