refactor(services): replace temporary variable pointer pattern with new() builtin

Simplify pointer creation in media scanner validation messages and worker
job timestamps by using inline new() instead of local variable + address-of.

In media_scanner.go this cleans up three validation error message returns
(manga/comics library format checks). In worker.go it simplifies StartedAt
and CompletedAt timestamp assignments.
This commit is contained in:
2026-04-20 08:58:19 -04:00
parent 9b141d75e8
commit 2b139afce6
2 changed files with 8 additions and 13 deletions
+2 -4
View File
@@ -221,8 +221,7 @@ func (w *Worker) processJob(job *Job) {
}
w.mu.Unlock()
now := time.Now()
job.StartedAt = &now
job.StartedAt = new(time.Now())
w.mu.Lock()
if result, exists := w.results[job.ID]; exists {
@@ -254,8 +253,7 @@ func (w *Worker) processJob(job *Job) {
err = fmt.Errorf("unknown job type: %s", job.Type)
}
completedAt := time.Now()
job.CompletedAt = &completedAt
job.CompletedAt = new(time.Now())
job.Error = err
job.Result = result