mirror of
https://github.com/dcarrillo/whatismyip.git
synced 2024-12-22 12:08:00 +00:00
Move models initial setup to server handler (not ideal)
This commit is contained in:
parent
1988241b98
commit
454f65f087
@ -12,7 +12,6 @@ import (
|
|||||||
"github.com/dcarrillo/whatismyip/server"
|
"github.com/dcarrillo/whatismyip/server"
|
||||||
"github.com/gin-contrib/secure"
|
"github.com/gin-contrib/secure"
|
||||||
|
|
||||||
"github.com/dcarrillo/whatismyip/models"
|
|
||||||
"github.com/dcarrillo/whatismyip/router"
|
"github.com/dcarrillo/whatismyip/router"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
@ -27,7 +26,6 @@ func main() {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
models.Setup(setting.App.GeodbPath.City, setting.App.GeodbPath.ASN)
|
|
||||||
engine := setupEngine()
|
engine := setupEngine()
|
||||||
router.SetupTemplate(engine)
|
router.SetupTemplate(engine)
|
||||||
router.Setup(engine)
|
router.Setup(engine)
|
||||||
|
@ -28,6 +28,7 @@ func Setup(servers []Server) *Manager {
|
|||||||
func (m *Manager) Run() {
|
func (m *Manager) Run() {
|
||||||
m.start()
|
m.start()
|
||||||
|
|
||||||
|
models.Setup(setting.App.GeodbPath.City, setting.App.GeodbPath.ASN)
|
||||||
signalChan := make(chan os.Signal, len(m.servers))
|
signalChan := make(chan os.Signal, len(m.servers))
|
||||||
signal.Notify(signalChan, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM)
|
signal.Notify(signalChan, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM)
|
||||||
var s os.Signal
|
var s os.Signal
|
||||||
|
Loading…
Reference in New Issue
Block a user