Beispiel #1
0
func waitShutdown(app application.Application) {
	c := make(chan os.Signal, 1)
	signal.Notify(c, os.Interrupt)
	signal.Notify(c, syscall.SIGTERM)

	go func() {
		<-c
		fmt.Println()
		log.Info.Pf("gracefully shutting down")

		log.Info.Pf("stopping http listener")
		manners.Close()
		log.Info.Pf("http listener stopped")

		app.Cleanup()

		log.Info.Pf("shutdown finished")
		os.Exit(1)
	}()
}
Beispiel #2
0
func newController(app application.Application) controller.Controller {
	strategy := rankStrategy.New(app.Database(), app.AppConfig().DbConfig())

	return controller.NewController(app, strategy)
}