Skip to content

Commit

Permalink
Fixed a code issue with static field not being initialized for a smal…
Browse files Browse the repository at this point in the history
…l amount of time.
  • Loading branch information
majora2007 committed Feb 19, 2025
1 parent 1177750 commit fc93a59
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions API/Services/Tasks/VersionUpdaterService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public partial class VersionUpdaterService : IVersionUpdaterService

[GeneratedRegex(@"^\n*(.*?)\n+#{1,2}\s", RegexOptions.Singleline)]
private static partial Regex BlogPartRegex();
private static string _cacheFilePath;
private readonly string _cacheFilePath;
private static readonly TimeSpan CacheDuration = TimeSpan.FromHours(1);

public VersionUpdaterService(ILogger<VersionUpdaterService> logger, IEventHub eventHub, IDirectoryService directoryService)
Expand Down Expand Up @@ -305,7 +305,7 @@ public async Task<IList<UpdateNotificationDto>> GetAllReleases(int count = 0)
return updateDtos;
}

private static async Task<IList<UpdateNotificationDto>?> TryGetCachedReleases()
private async Task<IList<UpdateNotificationDto>?> TryGetCachedReleases()
{
if (!File.Exists(_cacheFilePath)) return null;

Expand Down Expand Up @@ -492,7 +492,7 @@ private static string CleanSectionItem(string item)
return item;
}

sealed class PullRequestInfo
private sealed class PullRequestInfo
{
public required string Title { get; init; }
public required string Body { get; init; }
Expand All @@ -501,25 +501,25 @@ sealed class PullRequestInfo
public required int Number { get; init; }
}

sealed class CommitInfo
private sealed class CommitInfo
{
public required string Sha { get; init; }
public required CommitDetail Commit { get; init; }
public required string Html_Url { get; init; }
}

sealed class CommitDetail
private sealed class CommitDetail
{
public required string Message { get; init; }
public required CommitAuthor Author { get; init; }
}

sealed class CommitAuthor
private sealed class CommitAuthor
{
public required string Date { get; init; }
}

sealed class NightlyInfo
private sealed class NightlyInfo
{
public required string Version { get; init; }
public required int PrNumber { get; init; }
Expand Down

0 comments on commit fc93a59

Please sign in to comment.