Skip to content
Snippets Groups Projects
Commit 435ce339 authored by Travis Ralston's avatar Travis Ralston
Browse files

Fix NPEs when the initial log context is used

parent e273b833
No related branches found
No related tags found
Loading
...@@ -54,9 +54,9 @@ func scanAndStartUnfinishedTasks() error { ...@@ -54,9 +54,9 @@ func scanAndStartUnfinishedTasks() error {
return err return err
} }
logrus.Infof("Started replacement task ID %d for unfinished task %d (%s)", newTask.ID, task.ID, task.Name) taskCtx.Log.Infof("Started replacement task ID %d for unfinished task %d (%s)", newTask.ID, task.ID, task.Name)
} else { } else {
logrus.Warn(fmt.Sprintf("Unknown task %s at ID %d - ignoring", task.Name, task.ID)) taskCtx.Log.Warn(fmt.Sprintf("Unknown task %s at ID %d - ignoring", task.Name, task.ID))
} }
} }
......
...@@ -10,7 +10,7 @@ import ( ...@@ -10,7 +10,7 @@ import (
func Initial() RequestContext { func Initial() RequestContext {
return RequestContext{ return RequestContext{
Context: context.Background(), Context: context.Background(),
Log: &logrus.Entry{}, Log: logrus.WithFields(logrus.Fields{"nocontext": true}),
Config: config.DomainRepoConfig{ Config: config.DomainRepoConfig{
MinimumRepoConfig: config.Get().MinimumRepoConfig, MinimumRepoConfig: config.Get().MinimumRepoConfig,
Downloads: config.Get().Downloads.DownloadsConfig, Downloads: config.Get().Downloads.DownloadsConfig,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment