Skip to content

Commit

Permalink
Make the node start call asynchronous
Browse files Browse the repository at this point in the history
This makes the node open a listening port right away,
rather than waiting for the first discovery round
to complete.

It increases the node's connectivity to other nodes
which may want to establish a connection,
and consequently reduces CI failures.

Part of: #1117
  • Loading branch information
AndrejMitrovic committed Aug 13, 2020
1 parent 331e518 commit 1fc236b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/agora/node/Runner.d
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ import agora.utils.Log;

import ocean.util.log.ILogger;

import vibe.core.core;
import vibe.http.server;
import vibe.http.router;
import vibe.web.rest;

import std.file;
import std.format;

import core.time;

mixin AddLogger!();

/*******************************************************************************
Expand Down Expand Up @@ -86,7 +89,7 @@ public FullNode runNode (Config config)
res.writeVoidBody();
});

node.start(); // asynchronous
setTimer(0.seconds, &node.start, false); // asynchronous

log.info("About to listen to HTTP: {}", settings.port);
listenHTTP(settings, router);
Expand Down

0 comments on commit 1fc236b

Please sign in to comment.