fix(lint): clear the staticcheck findings

Drop the RealIP middleware: the worker listens on 127.0.0.1 only, and RealIP is deprecated because a client can set its own address. Log the restart error directly, since Restart only returns on failure. Remove an unused slice in a test and pass a real context instead of nil. staticcheck now reports nothing.
This commit is contained in:
2026-10-03 05:00:27 +01:00
parent daa9959961
commit 9d7959f98f
4 changed files with 8 additions and 12 deletions
+4 -6
View File
@@ -218,9 +218,8 @@ func (s *Service) handleUpdateRestart(w http.ResponseWriter, r *http.Request) {
// Restart in background after response is sent
go func() {
if err := s.updater.Restart(); err != nil {
log.Error().Err(err).Msg("Failed to restart worker")
}
// Restart only returns when the new worker failed to start.
log.Error().Err(s.updater.Restart()).Msg("Failed to restart worker")
}()
}
@@ -244,8 +243,7 @@ func (s *Service) handleRestart(w http.ResponseWriter, r *http.Request) {
go func() {
// Small delay to ensure response is sent
time.Sleep(100 * time.Millisecond)
if err := s.updater.Restart(); err != nil {
log.Error().Err(err).Msg("Failed to restart worker")
}
// Restart only returns when the new worker failed to start.
log.Error().Err(s.updater.Restart()).Msg("Failed to restart worker")
}()
}