Add depot, attendant, jetfire, optimus, ota services with kustomize overlays

This commit is contained in:
Chris Rai
2026-01-31 15:35:07 -05:00
parent a0ec642ca1
commit 9a5cb2f547
404 changed files with 38817 additions and 16 deletions

View File

@@ -0,0 +1,46 @@
package controllers
import (
"otaupdate/services"
"time"
"github.com/fiskerinc/cloud-services/pkg/health"
"github.com/fiskerinc/cloud-services/pkg/logger"
)
func HealthCheck() {
redis := health.NewRedisHealth(services.RedisClientPool())
server := health.HealthCheckServer{}
err := server.Serve([]health.Config{
{
Name: "db",
Check: health.NewPostgresCheck(services.GetDB().GetDBClient().GetConn()),
Timeout: time.Second * 1,
},
{
Name: "redis",
Check: redis.Check,
Timeout: time.Second * 1,
Info: redis.RedisStatus,
},
{
Name: "mongodb",
Check: health.NewMongoDBCheck(getMongoClient),
Timeout: time.Second * 1,
},
})
if err != nil {
logger.Error().Err(err).Send()
}
}
func getMongoClient() (health.MongoConnCheckInterface, error) {
client, err := services.GetMongoClient()
if err != nil {
return nil, err
}
conn := client.(health.MongoConnCheckInterface)
return conn, nil
}