Implement owner session expiration

This commit is contained in:
Rene Vergara 2022-05-17 15:06:38 -05:00
parent 0e6c71174a
commit b3482da312
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -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