From b11edb373f36ff7538a6c68222c1d85bb149d686 Mon Sep 17 00:00:00 2001 From: Erik De Smedt Date: Wed, 13 Mar 2024 21:50:06 +0100 Subject: [PATCH] Put a default expiry_time of 1hour Improve this do read form config variable --- plugins/lsps-server/src/lsps1/hooks/custommsg.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/lsps-server/src/lsps1/hooks/custommsg.rs b/plugins/lsps-server/src/lsps1/hooks/custommsg.rs index bd3baad..5b979e7 100644 --- a/plugins/lsps-server/src/lsps1/hooks/custommsg.rs +++ b/plugins/lsps-server/src/lsps1/hooks/custommsg.rs @@ -1,5 +1,6 @@ use anyhow::Result; use uuid::Uuid; +use std::time::Duration; use lsp_primitives::methods; @@ -64,7 +65,7 @@ pub(crate) async fn do_lsps1_create_order( // Define the relevant timestamps let now = IsoDatetime::now(); let created_at = now.clone(); - let expires_at = now.clone(); + let expires_at = IsoDatetime::from_offset_date_time(created_at.datetime() + Duration::from_secs(3600)); let order = typed_request.params; order