package serverimp

import "context"

func (i *Imp) shutdownApp() {
	if i == nil || i.app == nil {
		return
	}

	timeout := i.config.Runtime.ShutdownTimeout()
	ctx, cancel := context.WithTimeout(context.Background(), timeout)
	defer cancel()

	i.app.Shutdown(ctx)
	i.app = nil
}
