Skip to content

Commit

Permalink
home: imp docs, fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Jan 26, 2021
1 parent 22717ab commit 100a1a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions internal/home/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ func (web *Web) TLSConfigChanged(ctx context.Context, tlsConf tlsConfigSettings)

web.httpsServer.cond.L.Lock()
if web.httpsServer.server != nil {
withTO, cancel := context.WithTimeout(ctx, shutdownTimeout)
err = web.httpsServer.server.Shutdown(withTO)
ctx, cancel := context.WithTimeout(ctx, shutdownTimeout)
err = web.httpsServer.server.Shutdown(ctx)
cancel()
if err != nil {
log.Debug("error while shutting down HTTP server: %s", err)
Expand Down Expand Up @@ -215,9 +215,9 @@ func (web *Web) Close(ctx context.Context) {
if srv == nil {
return
}
withTO, cancel := context.WithTimeout(ctx, shutdownTimeout)
ctx, cancel := context.WithTimeout(ctx, shutdownTimeout)
defer cancel()
if err := srv.Shutdown(withTO); err != nil {
if err := srv.Shutdown(ctx); err != nil {
log.Debug("error while shutting down HTTP server: %s", err)
}
}
Expand Down
1 change: 0 additions & 1 deletion internal/home/whois.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ func (w *Whois) workerLoop() {
for {
ip := <-w.ipChan

// Refresh the context for process at each iteration.
info := w.process(context.Background(), ip)
if len(info) == 0 {
continue
Expand Down

0 comments on commit 100a1a0

Please sign in to comment.