Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ impl Timestamp {
timestamp: self.timestamp + duration.as_millis() as i64,
}
}

pub fn get(&self) -> i64 {
self.timestamp
}
}

pub struct Listener<T> {
Expand Down
3 changes: 3 additions & 0 deletions tests/document_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ fn database_document_expiration() {
.expect("document_expiration");
assert_eq!(doc_expiration.unwrap(), expiration);

let set_expiration = doc_expiration.unwrap().get();
assert_eq!(set_expiration, expiration.get());

// Check the document is still present after 1 second
sleep(Duration::from_secs(1));
assert!(default_collection(db).get_document("foo").is_ok());
Expand Down