internal: fix outposts not reacting to signals while starting

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-08-05 18:13:09 +02:00
parent ec42d378ab
commit d5703dce39
2 changed files with 14 additions and 4 deletions

View File

@ -52,11 +52,18 @@ func main() {
ex := common.Init() ex := common.Init()
defer common.Defer() defer common.Defer()
go func() {
for {
<-ex
os.Exit(0)
}
}()
ac := ak.NewAPIController(*akURLActual, akToken) ac := ak.NewAPIController(*akURLActual, akToken)
if ac == nil { if ac == nil {
os.Exit(1) os.Exit(1)
} }
defer ac.Shutdown()
ac.Server = ldap.NewServer(ac) ac.Server = ldap.NewServer(ac)
@ -67,7 +74,5 @@ func main() {
for { for {
<-ex <-ex
ac.Shutdown()
os.Exit(0)
} }
} }

View File

@ -55,11 +55,18 @@ func main() {
ex := common.Init() ex := common.Init()
defer common.Defer() defer common.Defer()
go func() {
for {
<-ex
os.Exit(0)
}
}()
ac := ak.NewAPIController(*akURLActual, akToken) ac := ak.NewAPIController(*akURLActual, akToken)
if ac == nil { if ac == nil {
os.Exit(1) os.Exit(1)
} }
defer ac.Shutdown()
ac.Server = proxyv2.NewProxyServer(ac) ac.Server = proxyv2.NewProxyServer(ac)
@ -70,7 +77,5 @@ func main() {
for { for {
<-ex <-ex
ac.Shutdown()
os.Exit(0)
} }
} }