1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +02:00

cmd/thalos/server.go: Set context timeout to eos api call.

This commit is contained in:
Henrik Hautakoski 2024-02-18 20:06:51 +01:00
parent 2382f72e5a
commit fb62e10667

View file

@ -247,7 +247,10 @@ func chainInfoOnce(api *eos.API) func() *eos.InfoResp {
log.WithField("api", api.BaseURL).Info("Get chain info from api")
result, err := api.GetInfo(context.Background())
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
defer cancel()
result, err := api.GetInfo(ctx)
if err != nil {
log.WithError(err).Fatal("Failed to call eos api")
return nil