Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b4033b5

Browse filesBrowse files
committed
added OnAppShutdown hook
1 parent 2a8a56f commit b4033b5
Copy full SHA for b4033b5

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed

‎server.go

Copy file name to clipboardExpand all lines: server.go
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ func runShutdownHooks() {
228228
INFO.Println("Done")
229229
}
230230

231+
func OnAppShutdown(f func()) {
232+
shutdownHooks = append(shutdownHooks, f)
233+
}
234+
231235
func StopServer() {
232236
INFO.Println("Server shutdown in progress")
233237
stopSig <- 1

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.