mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
fix(context): add context cancellation for graceful shutdown in Program function
This commit is contained in:
parent
918ae3a6b6
commit
06513abe4c
3 changed files with 6 additions and 5 deletions
3
main.go
3
main.go
|
@ -32,6 +32,9 @@ import (
|
|||
|
||||
func Program(ctx context.Context, confPath string) func(l []net.Listener) error {
|
||||
return func(l []net.Listener) error {
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
|
||||
listener := l[0]
|
||||
|
||||
cosy.RegisterMigrationsBeforeAutoMigrate(migrate.BeforeAutoMigrate)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue