Implement owner session expiration
This commit is contained in:
parent
0e6c71174a
commit
b3482da312
1 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue