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 backoff system implementation #1
Conversation
…backoffs can be placed in same tree.
go.mod
Outdated
@@ -0,0 +1,11 @@ | |||
module github.com/libp2p/go-libp2p-backoff | |||
|
|||
replace github.com/libp2p/go-libp2p-core => /Users/petar/src/github.com/libp2p/go-libp2p-core |
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.
remove
|
||
var BackoffGCInterval = time.Minute | ||
|
||
func (t *BackoffTreeTimer) StartGC() { |
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.
a task like this should probably run within a context
so that it can be completed on shutdown.
} | ||
} | ||
|
||
func TestTimerGC2(t *testing.T) { |
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.
a test with two children subtimers active in different go-routines would be potentially useful to find races.
cleanup: fix go.mod and staticcheck failures
sync: update CI config files
Highlights:
This PR depends on: libp2p/go-libp2p-core#127