refactor: graceful shutdown for server (#482)

This commit is contained in:
Alessandro (Ale) Segala
2025-04-28 18:13:50 +09:00
committed by GitHub
parent ce24372c57
commit 3ec98736cf
10 changed files with 209 additions and 90 deletions

View File

@@ -6,10 +6,12 @@ import (
_ "github.com/golang-migrate/migrate/v4/source/file"
"github.com/pocket-id/pocket-id/backend/internal/service"
"github.com/pocket-id/pocket-id/backend/internal/utils/signals"
)
func Bootstrap() {
ctx := context.TODO()
// Get a context that is canceled when the application is stopping
ctx := signals.SignalContext(context.Background())
initApplicationImages()