Skip to content

Commit

Permalink
More information to console
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Mar 24, 2023
1 parent bcd881d commit 70d7327
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/LinkDotNet.Blog.Web/Features/BlogPostPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ private async Task PublishScheduledBlogPosts()
using var scope = serviceProvider.CreateScope();
var repository = scope.ServiceProvider.GetRequiredService<IRepository<BlogPost>>();

var now = DateTime.UtcNow;
var now = DateTime.Now;
var scheduledBlogPosts = await repository.GetAllAsync(
filter: b => b.ScheduledPublishDate != null && b.ScheduledPublishDate <= now);

logger.LogInformation("Found {Count} scheduled blog posts.", scheduledBlogPosts.Count);

foreach (var blogPost in scheduledBlogPosts)
{
blogPost.Publish();
Expand Down

0 comments on commit 70d7327

Please sign in to comment.