summaryrefslogtreecommitdiff
path: root/src/mongo/db/ttl.cpp
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2015-05-07 16:45:29 -0400
committerAndy Schwerin <schwerin@mongodb.com>2015-05-13 17:58:55 -0400
commit532dfe1180c2da552bebed70af1e7fba34cf355c (patch)
tree9fb15c1576003307169bd249db500ad1aee21d99 /src/mongo/db/ttl.cpp
parentcd97edbe4be0e6ddc9139a21e13594fd19a26a5e (diff)
downloadmongo-532dfe1180c2da552bebed70af1e7fba34cf355c.tar.gz
SERVER-13874 Make mongo::Milliseconds et al. aliases for equivalent stdx::chrono types.
Also introduces operators for adding stdx::chrono::duration to Date_t, subtracting two Date_ts to get Milliseconds, and remove the use of reinterpret_cast from the implementation of BSON Timestamp type.
Diffstat (limited to 'src/mongo/db/ttl.cpp')
-rw-r--r--src/mongo/db/ttl.cpp7
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.