Skip to content

Commit

Permalink
add context: fix build (#46)
Browse files Browse the repository at this point in the history
Summary:
The build public build broke after D53320510.

Pull Request resolved: #46

Reviewed By: xaionaro

Differential Revision: D53407901

fbshipit-source-id: c5268007e5ebda76380e35324e96f3c2156c5e68
  • Loading branch information
pmazzini authored and facebook-github-bot committed Feb 6, 2024
1 parent 3ef6382 commit 7710845
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package main

import (
"context"
"flag"
"fmt"
"net/http"
Expand All @@ -30,6 +31,9 @@ func main() {
flag.Parse()
flag.Lookup("logtostderr").Value.Set("true")

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

if *configPath == "" {
glog.Fatal("Config file is necessary")
}
Expand Down Expand Up @@ -75,5 +79,5 @@ func main() {
}()

glog.Infof("Starting dhcplb in v%d mode", *version)
glog.Fatal(server.ListenAndServe())
glog.Fatal(server.ListenAndServe(ctx))
}

0 comments on commit 7710845

Please sign in to comment.