Skip to content

Commit

Permalink
Have hooks be initialized after apis (#2626)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielseibel1 authored Oct 20, 2023
1 parent 5ac7e5d commit 4acba03
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand All @@ -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

Expand All @@ -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")
Expand Down

0 comments on commit 4acba03

Please sign in to comment.