perf(db): release database before exit

This commit is contained in:
Andy Hsu
2023-09-05 13:04:27 +08:00
parent b604e21c69
commit 3231c3d930
6 changed files with 26 additions and 1 deletions

View File

@ -100,7 +100,7 @@ the address is defined in config file`,
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
<-quit
utils.Log.Println("Shutdown server...")
Release()
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
defer cancel()
var wg sync.WaitGroup