Skip to content
Snippets Groups Projects
Commit 51723c5d authored by Hans Moog's avatar Hans Moog
Browse files

Refactor: made request processor use timeutils

parent 0e840e1d
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,8 @@ package protocol
import (
"time"
"github.com/iotaledger/goshimmer/packages/timeutil"
"github.com/iotaledger/goshimmer/packages/accountability"
"github.com/iotaledger/goshimmer/packages/daemon"
"github.com/iotaledger/goshimmer/packages/node"
......@@ -41,11 +43,7 @@ func createOutgoingRequestProcessor(plugin *node.Plugin) func() {
func sendOutgoingRequests(plugin *node.Plugin) {
for _, chosenNeighborCandidate := range chosenneighbors.CANDIDATES.Clone() {
select {
case <-daemon.ShutdownSignal:
return
case <-time.After(5 * time.Second):
}
timeutil.Sleep(5 * time.Second)
if candidateShouldBeContacted(chosenNeighborCandidate) {
if dialed, err := chosenNeighborCandidate.Send(outgoingrequest.INSTANCE.Marshal(), types.PROTOCOL_TYPE_TCP, true); err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment