From b3482da31293405f8469271fd0a692c088ab28f0 Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Tue, 17 May 2022 15:06:38 -0500 Subject: [PATCH] Implement owner session expiration --- src/ZGoBackend.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ZGoBackend.hs b/src/ZGoBackend.hs index 947fe42..6ca20ec 100644 --- a/src/ZGoBackend.hs +++ b/src/ZGoBackend.hs @@ -645,4 +645,17 @@ payOwner p d x = ]) markPaymentDone pipe db pmt +expireOwners :: Pipe -> T.Text -> IO () +expireOwners pipe db = do + now <- getCurrentTime + _ <- + access + pipe + master + db + (modify + (select ["expiration" =: ["$lt" =: now]] "owners") + ["$set" =: ["paid" =: False]]) + return () + debug = flip trace