diff --git a/cmd/whatismyip.go b/cmd/whatismyip.go index b172965..d4eaf2b 100644 --- a/cmd/whatismyip.go +++ b/cmd/whatismyip.go @@ -12,7 +12,6 @@ import ( "github.com/dcarrillo/whatismyip/server" "github.com/gin-contrib/secure" - "github.com/dcarrillo/whatismyip/models" "github.com/dcarrillo/whatismyip/router" "github.com/gin-gonic/gin" ) @@ -27,7 +26,6 @@ func main() { os.Exit(1) } - models.Setup(setting.App.GeodbPath.City, setting.App.GeodbPath.ASN) engine := setupEngine() router.SetupTemplate(engine) router.Setup(engine) diff --git a/server/server.go b/server/server.go index 4817b50..0e444b1 100644 --- a/server/server.go +++ b/server/server.go @@ -28,6 +28,7 @@ func Setup(servers []Server) *Manager { func (m *Manager) Run() { m.start() + models.Setup(setting.App.GeodbPath.City, setting.App.GeodbPath.ASN) signalChan := make(chan os.Signal, len(m.servers)) signal.Notify(signalChan, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM) var s os.Signal