Skip to content

Commit 2440457

Browse files
committed
CR fixes
1 parent d0689bb commit 2440457

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/Microsoft.DotNet.Darc/DarcLib/GitHubClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ public async Task<IList<Review>> GetLatestPullRequestReviewsAsync(string pullReq
924924

925925
IGitHubClient client = GetClient(owner, repo);
926926
var pullRequestReviewsUri = ApiUrls.PullRequestReviews(owner, repo, id);
927-
string cacheKey = $"{owner}_{repo}_id";
927+
string cacheKey = $"{owner}_{repo}_{id}";
928928

929929
var pullRequestReviews = await RequestResourceUsingEtagsAsync<GithubPullRequestReviews, List<PullRequestReview>>(
930930
cacheKey,

src/Microsoft.DotNet.Darc/DarcLib/Helpers/GithubResourceConverters.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@ internal static GithubPullRequestReviews ConvertPullRequestReviews(IEnumerable<P
3737
TranslateReviewState(r.State.Value),
3838
r.PullRequestUrl,
3939
r.User.Login,
40-
r.SubmittedAt))
41-
.ToArray();
42-
40+
r.SubmittedAt));
41+
4342
return new GithubPullRequestReviews
4443
{
45-
Reviews = reviews
44+
Reviews = [.. reviews]
4645
};
4746
}
4847

src/ProductConstructionService/ProductConstructionService.Common/RedisCacheClient.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ internal class RedisCacheClient : IRedisCacheClient
1414
{
1515
private readonly IRedisCacheFactory _factory;
1616
private readonly ILogger<RedisCacheClient> _logger;
17+
private readonly TimeSpan _defaultExpiration = TimeSpan.FromDays(15);
1718

1819
public RedisCacheClient(IRedisCacheFactory factory, ILogger<RedisCacheClient> logger)
1920
{
@@ -30,7 +31,7 @@ public async Task<bool> TrySetAsync<T>(string key, T value, TimeSpan? expiration
3031
{
3132
try
3233
{
33-
await _factory.Create<T>(key).SetAsync(value, expiration);
34+
await _factory.Create<T>(key).SetAsync(value, expiration ?? _defaultExpiration);
3435
}
3536
catch (Exception ex)
3637
{

0 commit comments

Comments
 (0)