Implement health check for deploy. Make version endpoint to return revision if not set
This commit is contained in:
@@ -109,3 +109,17 @@ func (d *dbService) UpdatePayoutByPayoutID(payoutId string, updateModel orm.Payo
|
||||
p := d.getParams(opts...)
|
||||
return gorm.G[orm.Payout](d.db).Where("payout_id = ?", payoutId).Updates(p.ctx, updateModel)
|
||||
}
|
||||
|
||||
// HealthCheck implements [Service].
|
||||
func (d *dbService) HealthCheck() error {
|
||||
if d.db == nil {
|
||||
return errors.New("database connection is nil")
|
||||
}
|
||||
|
||||
db, err := d.db.DB()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return db.Ping()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user