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:
parent
ea3f7abde5
commit
37753a9648
1 changed files with 11 additions and 1 deletions
|
@ -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
|
void
|
||||||
ircd::server::close_all()
|
ircd::server::close_all()
|
||||||
{
|
{
|
||||||
log.debug("Closing all %zu peers",
|
log.debug("Closing all %zu peers",
|
||||||
peer_count());
|
peer_count());
|
||||||
|
|
||||||
|
net::close_opts opts;
|
||||||
|
opts.timeout = seconds(close_all_timeout);
|
||||||
|
|
||||||
for(auto &peer : peers)
|
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...",
|
log.debug("Waiting for %zu tags on %zu links on %zu peers to close...",
|
||||||
tag_count(),
|
tag_count(),
|
||||||
|
|
Loading…
Reference in a new issue