-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
On go 1.7 we will use Close() which will just kill the connection. It's highly recommened that you use 1.8 or later, so that there is a graceful shutdown.
- Loading branch information
Showing
6 changed files
with
45 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ | |
.idea | ||
documents | ||
*.toml | ||
tegola |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ tegola | |
static/debug | ||
static/landuse2 | ||
*.log | ||
*.zip | ||
configs | ||
osm_tools | ||
log.txt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// +build go1.8 | ||
|
||
package cmd | ||
|
||
import ( | ||
"context" | ||
"net/http" | ||
"time" | ||
|
||
gdcmd "github.com/gdey/cmd" | ||
) | ||
|
||
func shutdown(srv *http.Server) { | ||
gdcmd.OnComplete(func() { | ||
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond) | ||
defer cancel() // releases resources if slowOperation completes before timeout elapses | ||
srv.Shutdown(ctx) | ||
}) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// +build !go1.8 | ||
|
||
package cmd | ||
|
||
import ( | ||
"context" | ||
"net/http" | ||
"time" | ||
|
||
gdcmd "github.com/gdey/cmd" | ||
) | ||
|
||
func shutdown(srv *http.Server) { | ||
gdcmd.OnComplete(func() { | ||
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond) | ||
defer cancel() // releases resources if slowOperation completes before timeout elapses | ||
srv.Close() | ||
}) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ svg_files/* | |
configs | ||
configs/* | ||
_svg_files/* | ||
_* | ||
log.txt |