X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/bd29cfa5cdba4365faef20003e8856946b7b928c..02f24a0c4a01a7ab46645c21630b9f48065b4b96:/services/ws/event_source.go diff --git a/services/ws/event_source.go b/services/ws/event_source.go index edeb647e46..9acfca50e4 100644 --- a/services/ws/event_source.go +++ b/services/ws/event_source.go @@ -248,7 +248,8 @@ func (ps *pgEventSource) DB() *sql.DB { } func (ps *pgEventSource) DBHealth() error { - ctx, _ := context.WithDeadline(context.Background(), time.Now().Add(time.Second)) + ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(time.Second)) + defer cancel() var i int return ps.db.QueryRowContext(ctx, "SELECT 1").Scan(&i) } @@ -287,7 +288,7 @@ func (sink *pgEventSink) Stop() { // Ensure this sink cannot fill up and block the // server-side queue (which otherwise could in turn // block our mtx.Lock() here) - for _ = range sink.channel { + for range sink.channel { } }() sink.source.mtx.Lock()