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