Skip to content

Commit 6e98dbf

Browse files
committed
feat(app): cancel context after task done
1 parent d0c4aad commit 6e98dbf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/app/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ func (app *App) Close() {
3535
}
3636

3737
func (app *App) Shutdown() {
38-
ctx, _ := context.WithTimeout(context.Background(), time.Millisecond*100)
38+
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*100)
3939
app.vhostSvc.Shutdown(ctx)
40+
cancel()
41+
4042
app.logMan.CloseFiles()
4143
}
4244

0 commit comments

Comments
 (0)