-
Notifications
You must be signed in to change notification settings - Fork 159
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
race on gateway #403
race on gateway #403
Conversation
@@ -27,7 +27,9 @@ pub struct Config { | |||
/// default port to listen on | |||
pub port: u16, | |||
/// flag to toggle whether the gateway should use denylist on requests | |||
pub denylist: bool, | |||
pub use_denylist: bool, |
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.
heads up @Arqu, I've added a use_
prefix to avoid using up the denylist
configuration key on a boolean flag.
9665a70
to
0bdd9d5
Compare
iroh-resolver/src/racing.rs
Outdated
1 => self | ||
.http_resolvers | ||
.first() | ||
.ok_or_else(|| anyhow!("no gateway configured to fetch raw CIDs")), |
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.
How can this ever happen? We have already checked that there is an element.
Can we just call rand all the time? It's not going to make a difference.
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.
How can this ever happen? We have already checked that there is an element.
yeah this is dumb. Will fix.
Can we just call rand all the time? It's not going to make a difference.
I was unclear on the overhead of the allocation, and didn't have time to research. I'll trust that you know this is a super low cost &. I'll just call it all the time 😄
d78e136
to
df5f9f1
Compare
df5f9f1
to
21b4338
Compare
cc @fabricedesre, this PR moves the racing gateway functionality into the "main" gateway, and changes the configuration location. |
tried to make this as not-terrible as possible, by requiring an array of gateways, and randomly choosing a gateway when more than one is supplied.