diff --git a/YaeBlog.Core/Services/EssayScanService.cs b/YaeBlog.Core/Services/EssayScanService.cs index db14f83..98d71e1 100644 --- a/YaeBlog.Core/Services/EssayScanService.cs +++ b/YaeBlog.Core/Services/EssayScanService.cs @@ -133,13 +133,12 @@ public partial class EssayScanService( private static Task ScanUnusedImagesInternal(IEnumerable contents, DirectoryInfo root) { - Regex imageRegex = ImageRegex(); ConcurrentBag unusedImage = []; ConcurrentBag notFoundImage = []; Parallel.ForEach(contents, content => { - MatchCollection result = imageRegex.Matches(content.FileContent); + MatchCollection result = ImagePattern.Matches(content.FileContent); DirectoryInfo imageDirectory = new(Path.Combine(root.FullName, content.FileName)); Dictionary usedDictionary; @@ -182,7 +181,7 @@ public partial class EssayScanService( } [GeneratedRegex(@"\!\[.*?\]\((.*?)\)")] - private static partial Regex ImageRegex(); + private static partial Regex ImagePattern { get; } private void ValidateDirectory(string root, out DirectoryInfo drafts, out DirectoryInfo posts) { diff --git a/YaeBlog.Core/Services/RendererService.cs b/YaeBlog.Core/Services/RendererService.cs index 8ed7103..b463336 100644 --- a/YaeBlog.Core/Services/RendererService.cs +++ b/YaeBlog.Core/Services/RendererService.cs @@ -136,7 +136,8 @@ public partial class RendererService( } [GeneratedRegex(@"(? - net8.0 + net9.0 enable enable @@ -12,10 +12,10 @@ - - - - + + + + diff --git a/YaeBlog/Dockerfile b/YaeBlog/Dockerfile index 301432e..8883495 100644 --- a/YaeBlog/Dockerfile +++ b/YaeBlog/Dockerfile @@ -1,7 +1,7 @@ -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /app -COPY bin/Release/net8.0/publish/ ./ +COPY bin/Release/net9.0/publish/ ./ COPY source/ ./source/ COPY appsettings.json . diff --git a/YaeBlog/YaeBlog.csproj b/YaeBlog/YaeBlog.csproj index 976e76e..a95344c 100644 --- a/YaeBlog/YaeBlog.csproj +++ b/YaeBlog/YaeBlog.csproj @@ -5,12 +5,12 @@ - + - net8.0 + net9.0 enable enable