bool RGWLC::LCWorker::should_work(utime_t& now)
{
int start_hour;
- int start_minite;
+ int start_minute;
int end_hour;
- int end_minite;
+ int end_minute;
string worktime = cct->_conf->rgw_lifecycle_work_time;
- sscanf(worktime.c_str(),"%d:%d-%d:%d",&start_hour, &start_minite, &end_hour, &end_minite);
+ sscanf(worktime.c_str(),"%d:%d-%d:%d",&start_hour, &start_minute, &end_hour, &end_minute);
struct tm bdt;
time_t tt = now.sec();
localtime_r(&tt, &bdt);
- if ((bdt.tm_hour*60 + bdt.tm_min >= start_hour*60 + start_minite)||
- (bdt.tm_hour*60 + bdt.tm_min <= end_hour*60 + end_minite)) {
+ if ((bdt.tm_hour*60 + bdt.tm_min >= start_hour*60 + start_minute)||
+ (bdt.tm_hour*60 + bdt.tm_min <= end_hour*60 + end_minute)) {
return true;
} else {
return false;
int RGWLC::LCWorker::shedule_next_start_time(utime_t& now)
{
int start_hour;
- int start_minite;
+ int start_minute;
int end_hour;
- int end_minite;
+ int end_minute;
string worktime = cct->_conf->rgw_lifecycle_work_time;
- sscanf(worktime.c_str(),"%d:%d-%d:%d",&start_hour, &start_minite, &end_hour, &end_minite);
+ sscanf(worktime.c_str(),"%d:%d-%d:%d",&start_hour, &start_minute, &end_hour, &end_minute);
struct tm bdt;
time_t tt = now.sec();
time_t nt;
localtime_r(&tt, &bdt);
bdt.tm_hour = start_hour;
- bdt.tm_min = start_minite;
+ bdt.tm_min = start_minute;
bdt.tm_sec = 0;
nt = mktime(&bdt);
return (nt+24*60*60 - tt);