Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor logging additions #176

Merged
merged 3 commits into from
Jan 23, 2025
Merged

Minor logging additions #176

merged 3 commits into from
Jan 23, 2025

Conversation

nulltoken
Copy link
Collaborator

@nulltoken nulltoken commented Jan 22, 2025

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/NCronJob/Execution/StartupJobManager.cs 93.93% <100.00%> (+0.83%) ⬆️
src/NCronJob/Scheduler/QueueWorker.cs 78.84% <100.00%> (ø)

... and 1 file with indirect coverage changes

@nulltoken nulltoken requested a review from linkdotnet January 22, 2025 21:32
@@ -50,4 +57,10 @@ public async Task ProcessStartupJobs(CancellationToken stopToken)

private async Task CreateExecutionTask(JobRun job, CancellationToken stopToken) =>
await jobProcessor.ProcessJobAsync(job, stopToken).ConfigureAwait(false);

[LoggerMessage(LogLevel.Information, "Triggering startup jobs execution at {at:o}")]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As they're only going to be logged once, I figured using a Information log level would work. Thoughts?

@nulltoken
Copy link
Collaborator Author

nulltoken commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅
Files with missing lines Coverage Δ
src/NCronJob/Execution/StartupJobManager.cs 93.93% <100.00%> (+0.83%) ⬆️
src/NCronJob/Scheduler/QueueWorker.cs 78.84% <100.00%> (ø)

... and 1 file with indirect coverage changes

@linkdotnet BTW, those links don't seem to work anymore. All I got are 404s.
What's the status on your side?

@linkdotnet
Copy link
Member

@linkdotnet BTW, those links don't seem to work anymore. All I got are 404s. What's the status on your side?

Same here. I hope that is just a bug and they fix that. It does work on main

@@ -195,13 +195,13 @@ private void HandleUpdate(object? sender, NotifyCollectionChangedEventArgs e)
case NotifyCollectionChangedAction.Add:
foreach (JobRun job in e.NewItems!)
{
LogJobAddedToQueue(job.JobDefinition.Type.Name, job.RunAt?.LocalDateTime);
LogJobAddedToQueue(job.JobDefinition.Type.Name, job.RunAt);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good catch

@linkdotnet linkdotnet merged commit 400805a into main Jan 23, 2025
5 checks passed
@linkdotnet linkdotnet deleted the ntk/startup_logs branch January 23, 2025 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants