0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 00:32:35 +01:00

ircd::server: Make close timeout shorter on close_all (shutdown).

This commit is contained in:
Jason Volk 2018-03-06 04:56:45 -08:00
parent ea3f7abde5
commit 37753a9648

View file

@ -150,14 +150,24 @@ ircd::server::accumulate_peers(F&& closure)
});
}
ircd::conf::item<ircd::seconds>
close_all_timeout
{
{ "name", "ircd.server.close_all_timeout" },
{ "default", 2L },
};
void
ircd::server::close_all()
{
log.debug("Closing all %zu peers",
peer_count());
net::close_opts opts;
opts.timeout = seconds(close_all_timeout);
for(auto &peer : peers)
peer.second->close();
peer.second->close(opts);
log.debug("Waiting for %zu tags on %zu links on %zu peers to close...",
tag_count(),