1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-08-31 21:38:12 +02:00

internal/api/atomicasset.go: Support host parameter.

This commit is contained in:
Henrik Hautakoski 2023-02-07 08:38:21 +01:00
parent f0ab79ef06
commit 59399c7cf4
No known key found for this signature in database
GPG key ID: 217490840C18A5D9
3 changed files with 18 additions and 15 deletions

View file

@ -13,16 +13,18 @@ type AtomicAsset struct {
utils.Time
url string
host string
block_time float64
}
func AtomicAssetFactory(args ApiArguments) ApiInterface {
return NewAtomicAsset(args.Url, float64(args.NumBlocks/2))
return NewAtomicAsset(args.Url, args.Host, float64(args.NumBlocks/2))
}
func NewAtomicAsset(url string, block_time float64) AtomicAsset {
func NewAtomicAsset(url string, host string, block_time float64) AtomicAsset {
return AtomicAsset{
url: url,
host: host,
block_time: block_time,
}
}
@ -37,6 +39,7 @@ func (e AtomicAsset) LogInfo() LogParams {
func (e AtomicAsset) Call(ctx context.Context) (agentcheck.Response, string) {
client := atomicasset.NewWithContext(e.url, ctx)
client.Host = e.host
h, err := client.GetHealth()
if err != nil {