-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat: retry crawl if peer is down #357
Conversation
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.
_crawlClient()
will return immediately even if it is waiting to retry, which is misleading. Also, if the retry fails it will do so silently.
You want the retries to happen in the background (the connector should already start broadcasting to the peers that were crawled so far), but you're right, I'll see if I can find a cleaner way to achieve that. Maybe we should rename the function to 'startCrawlClient' or something, to make it clearer |
d31b902
to
e2d01d5
Compare
Codecov Report
@@ Coverage Diff @@
## master #357 +/- ##
==========================================
- Coverage 82.42% 78.56% -3.87%
==========================================
Files 34 34
Lines 1195 1199 +4
Branches 189 189
==========================================
- Hits 985 942 -43
- Misses 210 257 +47
Continue to review full report at Codecov.
|
src/lib/route-broadcaster.js
Outdated
// follow-up attempts happen in the background until successful | ||
// but this generator function already returns | ||
setTimeout(() => { | ||
this._crawlClient(client) |
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.
Doesn't this function no longer exist?
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.
ah :) sorry. fixed.
e2d01d5
to
01c9ac1
Compare
src/lib/route-broadcaster.js
Outdated
// follow-up attempts happen in the background until successful | ||
// but this generator function already returns | ||
setTimeout(() => { | ||
this._startCrawlClient(client) |
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.
Doesn't this need to be in a co()
, since _startCrawlClient
is a generator?
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.
I guess I should add a unit test to this PR :)
01c9ac1
to
8ddd32f
Compare
@sentientwaffle I vaguely remember you solved this issue (and the underlying interledger-deprecated/ilp-kit#435) in a different PR? If not I'll take another look at this once I'm back from holidays. |
I think you're right, #386 should fix this issue. When the plugin connects |
ok, will close this then. we should test this in the next version of ilp-kit to check if it's really fixed now. |
No description provided.