Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add notify accept signal #1740

Merged
merged 5 commits into from
Feb 19, 2019
Merged

add notify accept signal #1740

merged 5 commits into from
Feb 19, 2019

Conversation

awkj
Copy link
Contributor

@awkj awkj commented Jan 10, 2019

  • With pull requests:
    • Open your pull request against master
    • Your pull request should have no more than two commits, if not you should squash them.
    • It should pass all tests in the available continuous integrations systems such as TravisCI.
    • You should add/modify tests to cover your proposed code changes.
    • If your pull request contains a new feature, please document it on the README.

Add a example

kill command will default send syscall.SIGTERM, add it in example will friendly to gin user.

@thinkerou
Copy link
Member

@awkj also need to update readme

error info:

0.14s$ make embedmd
embedmd -d *.md
@@ -1660,7 +1660,10 @@
 	// Wait for interrupt signal to gracefully shutdown the server with
 	// a timeout of 5 seconds.
 	quit := make(chan os.Signal)
-	signal.Notify(quit, os.Interrupt)
+	// kill (no param) default send syscanll.SIGTERM
+	// kill -2 is syscall.SIGINT
+	// kill -9 is syscall. SIGKILL but can"t be catch
+	signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
 	<-quit
 	log.Println("Shutdown Server ...")
 
make: *** [embedmd] Error 2
The command "make embedmd" exited with 2.

@awkj
Copy link
Contributor Author

awkj commented Feb 15, 2019

I should add readme.md to this folder?

@thinkerou
Copy link
Member

thinkerou commented Feb 19, 2019

@awkj no, you should update readme.md file which makes it the same as server.go. update the part: https://github.com/gin-gonic/gin#graceful-restart-or-stop

@codecov
Copy link

codecov bot commented Feb 19, 2019

Codecov Report

Merging #1740 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1740   +/-   ##
=======================================
  Coverage   98.48%   98.48%           
=======================================
  Files          41       41           
  Lines        2044     2044           
=======================================
  Hits         2013     2013           
  Misses         19       19           
  Partials       12       12

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 31bbb10...264acb6. Read the comment docs.

@thinkerou thinkerou self-requested a review February 19, 2019 15:45
@awkj
Copy link
Contributor Author

awkj commented Feb 19, 2019

@awkj no, you should update readme.md file which makes it the same as server.go. update the part: https://github.com/gin-gonic/gin#graceful-restart-or-stop

thanks reply, I already add it to README.md

@thinkerou thinkerou merged commit 5846ceb into gin-gonic:master Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants