From 03c73fa89f9e477f07c1159d7335a41947e39794 Mon Sep 17 00:00:00 2001 From: ayushtom Date: Wed, 6 Mar 2024 16:49:00 +0530 Subject: [PATCH] feat: add timestamp --- src/utils.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils.rs b/src/utils.rs index b7920948..7ba87258 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -230,6 +230,7 @@ impl CompletedTasksTrait for AppState { // save the user_exp document in the collection let user_exp_collection = self.db.collection("user_exp"); // add doc with address ,experience and timestamp + let timestamp: f64 = Utc::now().timestamp_millis() as f64; let document = doc! { "address": addr.to_string(), "experience":experience, "timestamp":timestamp}; user_exp_collection.insert_one(document, None).await?; let view_collection: Collection = @@ -320,6 +321,7 @@ impl AchievementsTrait for AppState { let user_exp_collection = self.db.collection("user_exp"); // add doc with address ,experience and timestamp + let timestamp: f64 = Utc::now().timestamp_millis() as f64; let document = doc! { "address": addr.to_string(), "experience":experience, "timestamp":timestamp}; user_exp_collection.insert_one(document, None).await?; let view_collection: Collection =