Skip to content

Commit

Permalink
disabled /broadcast and added TODO for future implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
azazeal committed Sep 19, 2021
1 parent 4e0258d commit 0f89434
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func serve(parent context.Context, logger *zap.Logger, l net.Listener, h http.Ha

select {
case <-parent.Done():
ctx, cancel := context.WithTimeout(context.TODO(), time.Minute>>1)
ctx, cancel := context.WithTimeout(context.Background(), time.Minute>>1)
defer cancel()

_ = srv.Shutdown(ctx)
Expand Down Expand Up @@ -161,7 +161,7 @@ func broadcast(w http.ResponseWriter, r *http.Request) {
With(log.Data(wrapper.Body)).
With(zap.Bool("globally", wrapper.Globally))

// TODO: implement
// TODO: implement via implementing a broadcast.Broadcaster struct

respondWith(w, http.StatusNoContent)
}
Expand Down Expand Up @@ -192,8 +192,8 @@ func newMux(ctx context.Context) (mux *http.ServeMux) {

hc := health.FromContext(ctx)
match("/health", hc, http.MethodGet, http.MethodHead)

matchFunc("/broadcast", broadcast, http.MethodPost)
// TODO: re-enable once HTTP broadcasting is implemented
// matchFunc("/broadcast", broadcast, http.MethodPost)
matchFunc("/", index, http.MethodGet)

return
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func main() {

func run() (err error) {
var ctx context.Context
if ctx, err = newContext(context.TODO()); err != nil {
if ctx, err = newContext(context.Background()); err != nil {
return
}

Expand Down

0 comments on commit 0f89434

Please sign in to comment.