diff options
Diffstat (limited to 'src/mongo/db/ttl.cpp')
-rw-r--r-- | src/mongo/db/ttl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp index 43845ffaa34..facbb58082c 100644 --- a/src/mongo/db/ttl.cpp +++ b/src/mongo/db/ttl.cpp @@ -231,7 +231,7 @@ namespace mongo { // Read the current time outside of the while loop, so that we don't expand our index // bounds after every WriteConflictException. - unsigned long long now = curTimeMillis64(); + const Date_t now = Date_t::now(); long long numDeleted = 0; int attempt = 1; @@ -284,10 +284,11 @@ namespace mongo { return true; } - const Date_t kDawnOfTime(std::numeric_limits<long long>::min()); + const Date_t kDawnOfTime = + Date_t::fromMillisSinceEpoch(std::numeric_limits<long long>::min()); const BSONObj startKey = BSON("" << kDawnOfTime); const BSONObj endKey = - BSON("" << Date_t(now - (1000 * secondsExpireElt.numberLong()))); + BSON("" << now - Seconds(secondsExpireElt.numberLong())); const bool endKeyInclusive = true; // The canonical check as to whether a key pattern element is "ascending" or // "descending" is (elt.number() >= 0). This is defined by the Ordering class. |