-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
validate middleware #156
validate middleware #156
Conversation
|
||
pub fn validate(&self, client: Arc<Client>, request: CallRequest, response: CallResult) { | ||
tokio::spawn(async move { | ||
let healthy_endpoints = client.endpoints().iter().filter(|x| x.health().score() > 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we have a helper method healthy_endpoints
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah makes sense
pub fn validate(&self, client: Arc<Client>, request: CallRequest, response: CallResult) { | ||
tokio::spawn(async move { | ||
let healthy_endpoints = client.endpoints().iter().filter(|x| x.health().score() > 0); | ||
futures::future::join_all(healthy_endpoints.map(|endpoint| async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to filter out the current endpoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response may come from cache, so why not hit them all
maybe have an example config file |
I think it's easy to copy/paste config from README and make use of validator |
* subsquid indexer & processor fix (AcalaNetwork#150) * update deps (AcalaNetwork#155) * bypass cache for unfinalized blocks (AcalaNetwork#154) * endpoint health (AcalaNetwork#152) * Await healthy endpoint (AcalaNetwork#158) * use only tracing (AcalaNetwork#157) * Filter call errors (AcalaNetwork#159) * validate middleware (AcalaNetwork#156) * validate middleware * validate extension for config * rename * Improve env handling via preprocessing templated config files (AcalaNetwork#162) * Feat(config): support ${var:-word} and ${var:+word} syntax (AcalaNetwork#164) * fix cli default value (AcalaNetwork#169) * improve reconnect wait time (AcalaNetwork#168) --------- Co-authored-by: mrq1911 <lumir.mrkva@topmonks.com> Co-authored-by: Ermal Kaleci <ermalkaleci@gmail.com> Co-authored-by: Jiyuan Zheng <indirection42@outlook.com>
closes #75