RoadSign/pkg/navi/warden.go

27 lines
559 B
Go
Raw Normal View History

2024-01-24 16:09:39 +00:00
package navi
2025-01-14 10:06:01 +00:00
import (
"git.solsynth.dev/goatworks/roadsign/pkg/warden"
"github.com/rs/zerolog/log"
)
2024-01-24 16:09:39 +00:00
func InitializeWarden(regions []*Region) {
2024-01-31 05:46:12 +00:00
pool := make([]*warden.AppInstance, 0)
2025-01-14 10:06:01 +00:00
log.Info().Msg("Starting Warden applications...")
2024-01-24 16:09:39 +00:00
for _, region := range regions {
for _, application := range region.Applications {
2024-01-31 05:46:12 +00:00
pool = append(pool, &warden.AppInstance{
2024-01-24 16:09:39 +00:00
Manifest: application,
})
}
}
2024-01-31 05:46:12 +00:00
// Hot swap
warden.InstancePool = pool
2025-01-14 10:06:01 +00:00
errs := warden.StartPool()
log.Info().Any("errs", errs).Msg("Warden applications has been started.")
2024-01-24 16:09:39 +00:00
}