Skip to content

Commit

Permalink
fix ttl test
Browse files Browse the repository at this point in the history
  • Loading branch information
pengweisong committed Sep 28, 2022
1 parent f98ce56 commit a03a361
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/storage/CommonUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ bool CommonUtils::checkDataExpiredForTTL(const meta::SchemaProviderIf* schema,
ftype != nebula::cpp2::PropertyType::INT64) {
return false;
}
auto now = ::time(NULL);
auto now = std::time(NULL);

// if the value is not INT type (sush as NULL), it will never expire.
// TODO (sky) : DateTime
Expand Down
4 changes: 2 additions & 2 deletions src/storage/test/QueryTestUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class QueryTestUtils {
}
auto indexes =
IndexKeyUtils::vertexIndexKeys(spaceVidLen, partId, indexId, vId, {std::move(row)});
auto val = FLAGS_mock_ttl_col ? IndexKeyUtils::indexVal(time::WallClock::fastNowInSec()) : "";
auto val = FLAGS_mock_ttl_col ? IndexKeyUtils::indexVal(std::time(NULL)) : "";
for (auto& index : indexes) {
data.emplace_back(std::move(index), std::move(val));
}
Expand All @@ -287,7 +287,7 @@ class QueryTestUtils {
}
auto indexes = IndexKeyUtils::edgeIndexKeys(
spaceVidLen, partId, indexId, srcId, rank, dstId, {std::move(row)});
auto val = FLAGS_mock_ttl_col ? IndexKeyUtils::indexVal(time::WallClock::fastNowInSec()) : "";
auto val = FLAGS_mock_ttl_col ? IndexKeyUtils::indexVal(std::time(NULL)) : "";
for (auto& index : indexes) {
data.emplace_back(std::move(index), val);
}
Expand Down

0 comments on commit a03a361

Please sign in to comment.