提交 315e5327 编写于 作者: X Xu Peng

fix(db): get group bug fix


Former-commit-id: 0a7cc7e3791bf02ea899a3cafdc5698e52334027
上级 4eea03af
......@@ -118,7 +118,7 @@ Status DBMetaImpl::delete_group_partitions(const std::string& group_id,
return status;
}
auto yesterday = GetDate(-2);
auto yesterday = GetDateWithDelta(-2);
for (auto& date : dates) {
if (date >= yesterday) {
......
......@@ -31,10 +31,14 @@ DateT Meta::GetDate(const std::time_t& t, int day_delta) {
return ltm->tm_year*10000 + ltm->tm_mon*100 + ltm->tm_mday;
}
DateT Meta::GetDate(int day_delta) {
DateT Meta::GetDateWithDelta(int day_delta) {
return GetDate(std::time(nullptr), day_delta);
}
DateT Meta::GetDate() {
return GetDate(std::time(nullptr), 0);
}
} // namespace meta
} // namespace engine
} // namespace vecwise
......
......@@ -100,8 +100,9 @@ public:
virtual Status count(const std::string& group_id, long& result) = 0;
static DateT GetDate(const std::time_t& t, int day_delta);
static DateT GetDate(int day_delta = 0);
static DateT GetDate(const std::time_t& t, int day_delta = 0);
static DateT GetDate();
static DateT GetDateWithDelta(int day_delta);
}; // MetaData
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册