mirror of
https://github.com/XTXMarkets/ternfs.git
synced 2026-01-05 18:40:16 -06:00
Actually wait for things to finish terminating before reaping next one
Fixes #27. This is all kind of clunky right now, it would be much better to just standardize the `run()` function pattern.
This commit is contained in:
@@ -19,11 +19,9 @@ static std::string generateErrString(const std::string& what, int err) {
|
||||
Xmon::Xmon(
|
||||
Logger& logger,
|
||||
std::shared_ptr<XmonAgent>& agent,
|
||||
const XmonConfig& config,
|
||||
std::atomic<bool>& stop
|
||||
const XmonConfig& config
|
||||
) :
|
||||
_env(logger, agent, "xmon"),
|
||||
_stop(stop),
|
||||
_agent(agent),
|
||||
_appType("restech.info"),
|
||||
_xmonHost(config.prod ? "REDACTED" : "REDACTED"),
|
||||
@@ -196,7 +194,7 @@ reconnect:
|
||||
// Start recv loop
|
||||
bool gotHeartbeat = false;
|
||||
for (;;) {
|
||||
bool shutDown = _stop.load();
|
||||
bool shutDown = _stopper.shouldStop();
|
||||
|
||||
// send all requests
|
||||
if (gotHeartbeat) {
|
||||
@@ -230,6 +228,7 @@ reconnect:
|
||||
if (shutDown) {
|
||||
LOG_DEBUG(_env, "got told to stop, stopping");
|
||||
close(sock);
|
||||
_stopper.stopDone();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user