add shutdown context unit test

This commit is contained in:
iofq committed 2024-11-09 15:34:35 -06:00
1 parent 8436001d5b
commit 840b76228a
2 files changed
+11

No files matched your search

+1
View File
@@ -65,6 +65,7 @@ func aptlyAPIServe(cmd *commander.Command, args []string) error {
signal.Notify(sigchan, syscall.SIGINT, syscall.SIGTERM)
go (func() {
if _, ok := <-sigchan; ok {
fmt.Printf("\nShutdown signal received, waiting for background tasks...\n")
context.TaskList().Wait()
server.Shutdown(stdcontext.Background())
}