decred / dcrdata

Decred block explorer, with packages and apps for data collection and storage. Written in Go.
https://dcrdata.decred.org/
ISC License
129 stars 128 forks source link

Detect when connection to dcrd is not available and display outage http view #356

Open raedah opened 6 years ago

raedah commented 6 years ago

When connection to dcrd is lost or unavailable, display a msg to web visitors about an outage.

chappjc commented 5 years ago

Currently a lost dcrd connection is bad news and there is currently a PR to disable autoreconnect: https://github.com/decred/dcrdata/pull/1130 In the future, a better solution that detects disconnect and reconnect can perhaps be implemented, but that's presently not straightforward.

ukane-philemon commented 1 year ago

@chappjc, how do we want this to be? A mini banner with a message on the UI and a message to API consumers?

chappjc commented 1 year ago

I'd say something down at the bottom near the red/green indicator. Maybe orange with next next to it. But, meh

ukane-philemon commented 1 year ago

I'd say something down at the bottom near the red/green indicator. Maybe orange with next next to it. But, meh

Okay, then how about API consumers?

chappjc commented 1 year ago

I'd say something down at the bottom near the red/green indicator. Maybe orange with next next to it. But, meh

Okay, then how about API consumers?

I'd have to check, but I think the "ready" flag already handles this.

ukane-philemon commented 1 year ago

I think the "ready" flag already handles this.

It should but I don't think it is set when we fail to update connections(which will fail if the node is disconnected).

I'm thinking c.Status should be set to false if we fail at line 167.

https://github.com/decred/dcrdata/blob/master/cmd/dcrdata/internal/api/apiroutes.go#L166-#L200