0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
This commit is contained in:
Dwight Merriman 2010-04-18 12:35:37 -04:00
parent 3664f5a5c9
commit a9cb4e6918
2 changed files with 6 additions and 1 deletions

View File

@ -41,6 +41,7 @@ namespace mongo {
}
} cmdReplSetHeartbeat;
/* poll every other set member to check its status */
class FeedbackThread : public BackgroundJob {
public:
ReplSet::MemberInfo *m;
@ -51,6 +52,9 @@ namespace mongo {
BSONObj info;
bool ok = conn.simpleCommand("admin", &info, "replSetHeartbeat");
log() << "TEMP heartbeat " << ok << ' ' << info.toString() << endl;
if( ok ) {
m->lastHeartbeat = time(0);
}
}
catch(...) {
log() << "TEMP heartbeat not ok" << endl;

View File

@ -59,8 +59,9 @@ namespace mongo {
const char *host;
int port;
int lastHeartbeat;
time_t lastHeartbeat;
};
/* all members of the set EXCEPT SELF. */
List1<MemberInfo> _members;
void startHealthThreads();