提交 36cc019f 编写于 作者: X Xu Peng

fix(db): get group bug fix


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