Have hooks be initialized after apis (#2626)

This commit is contained in:
Gabriel de Souza Seibel 2023-10-20 03:41:17 -03:00 committed by GitHub
parent 5ac7e5d2c9
commit 4acba03b62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

15
main.go
View file

@ -49,6 +49,7 @@ func main() {
defer stop()
var waitGroup sync.WaitGroup
startControllers(&waitGroup, ctx) // start the api endpoint and mq and stun
startHooks()
<-ctx.Done()
waitGroup.Wait()
}
@ -64,6 +65,14 @@ func setupConfig(absoluteConfigPath string) {
}
}
func startHooks() {
err := logic.TimerCheckpoint()
if err != nil {
logger.Log(1, "Timer error occurred: ", err.Error())
}
logic.EnterpriseCheck()
}
func initialize() { // Client Mode Prereq Check
var err error
@ -83,12 +92,6 @@ func initialize() { // Client Mode Prereq Check
logic.SetJWTSecret()
err = logic.TimerCheckpoint()
if err != nil {
logger.Log(1, "Timer error occurred: ", err.Error())
}
logic.EnterpriseCheck()
var authProvider = auth.InitializeAuthProvider()
if authProvider != "" {
logger.Log(0, "OAuth provider,", authProvider+",", "initialized")