MCPcopy Create free account
hub / github.com/Tencent/phxqueue / DoRun

Method DoRun

phxqueue/scheduler/keepmasterthread.cpp:70–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void KeepMasterThread::DoRun() {
71 impl_->scheduler->OnKeepMasterThreadRun();
72
73 comm::RetCode ret{InitMasterRate()};
74 if (comm::RetCode::RET_OK != ret) {
75 QLErr("MASTERSTAT: InitMasterRate ret %d", ret);
76
77 exit(-1);
78 }
79
80 while (true) {
81 if (comm::RetCode::RET_OK != (ret = AdjustMasterRate())) {
82 QLErr("MASTERSTAT: AdjustMasterRate ret %d", ret);
83 }
84 if (comm::RetCode::RET_OK != (ret = KeepMaster())) {
85 QLErr("MASTERSTAT: KeepMaster ret %d", ret);
86 }
87
88 QLInfo("sleep 10");
89 sleep(10);
90 }
91}
92
93comm::RetCode KeepMasterThread::InitMasterRate() {
94 impl_->master_rate = 100;

Callers

nothing calls this directly

Calls 1

OnKeepMasterThreadRunMethod · 0.80

Tested by

no test coverage detected