We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 87c9d49 + 014a6a8 commit e8346fdCopy full SHA for e8346fd
boot.go
@@ -183,6 +183,13 @@ func (boot *Boot) Bootstrap(ctx context.Context) {
183
func (boot *Boot) WaitForShutdownSig(ctx context.Context) {
184
rkentry.GlobalAppCtx.WaitForShutdownSig()
185
186
+ boot.Shutdown(ctx)
187
+}
188
+
189
+// Shutdown shutdown boot. for non-web application
190
+// 1: Call shutdown hook function added by user.
191
+// 2: Call interrupt function of entries in rkentry.GlobalAppCtx.
192
+func (boot *Boot) Shutdown(ctx context.Context) {
193
// Call shutdown hook function
194
for _, f := range rkentry.GlobalAppCtx.ListShutdownHooks() {
195
f()
0 commit comments