-
Notifications
You must be signed in to change notification settings - Fork 233
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
Add timeout #351
Add timeout #351
Conversation
// run it! | ||
res, err := query.Run(ctx, tablepeers) | ||
res, err := query.Run(timedCtx, tablepeers) |
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.
@Stebalien is this what you're talking about?
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.
Exactly! If we want to get fancy, we could even get the deadline from the context and subtract 1(?) second (we should be connected to the closest peers when this command returns.
Yay for arbitrary constants!
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.
This will strictly improve things for now.
Wait, why don't we just make sure callers pass a timeout? |
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.
Fine, we can make the timeouts better later, as steb says
We noticed some odd behavior around the provide call ipfs/go-ipfs-provider#8