MCPcopy Create free account
hub / github.com/Tencent/phxsql / run

Method run

phxsqlproxy/group_status_cache.cpp:47–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void GroupStatusCache::run() {
48 while (true) {
49 int sleep_ms = 300;
50
51 int ret = UpdateMasterStatus();
52 if (ret != 0) {
53 sleep_ms = 100;
54 LogError("UpdateMasterStatus ret %d", ret);
55 }
56 LogVerbose("UpdateMasterStatus ret %d", ret);
57
58 ret = UpdateMembership();
59 if (ret != 0) {
60 sleep_ms = 100;
61 LogError("UpdateMembership ret %d", ret);
62 }
63 LogVerbose("UpdateMembership ret %d", ret);
64
65 poll(0, 0, sleep_ms);
66 }
67}
68
69int GroupStatusCache::UpdateMasterStatus() {
70 if (std::string(config_->GetSpecifiedMasterIP()) != "") {

Callers

nothing calls this directly

Calls 2

LogErrorFunction · 0.85
LogVerboseFunction · 0.85

Tested by

no test coverage detected