| 128 | } |
| 129 | |
| 130 | int CheckPointManager::MakeCheckPoint(const vector<string> >idlist) { |
| 131 | StatusRunningHandler handler(this); |
| 132 | int ret = handler.TestAndSet(RUNNINGSTATUS::NONE, RUNNINGSTATUS::RUNNING); |
| 133 | if (ret) { |
| 134 | ColorLogInfo("%s something is running, skip", __func__); |
| 135 | return SVR_FAIL; |
| 136 | } |
| 137 | |
| 138 | uint32_t nowtime = time(NULL); |
| 139 | if (nowtime - last_checkpoint_time > option_->GetBinLogSvrConfig()->GetCheckPointMakingPeriod() |
| 140 | || nowtime - last_checkpoint_time > 60) { |
| 141 | if (last_checkpoint_time > 0) |
| 142 | ret = RealMakeCheckPoint(gtidlist); |
| 143 | if (ret == OK) { |
| 144 | last_checkpoint_time = nowtime; |
| 145 | } |
| 146 | } else { |
| 147 | ColorLogInfo("%s now time %u last check time %u, interval time %u", __func__, nowtime, last_checkpoint_time, |
| 148 | option_->GetBinLogSvrConfig()->GetCheckPointMakingPeriod()); |
| 149 | } |
| 150 | |
| 151 | ColorLogInfo("%s check point check done", __func__); |
| 152 | return OK; |
| 153 | } |
| 154 | |
| 155 | int CheckPointManager::GetNewestCheckPoint(EventData *eventdata, MasterInfo *masterinfo, EventDataInfo *eventdatainfo) { |
| 156 | StatusRunningHandler handler(this); |
nothing calls this directly
no test coverage detected