13 lines
386 B
Haskell
13 lines
386 B
Haskell
module Jobs.Handler.PruneInvitations
|
|
( dispatchJobPruneInvitations
|
|
) where
|
|
|
|
import Import
|
|
|
|
import Database.Persist.Sql (deleteWhereCount)
|
|
|
|
dispatchJobPruneInvitations :: Handler ()
|
|
dispatchJobPruneInvitations = do
|
|
now <- liftIO getCurrentTime
|
|
n <- runDB $ deleteWhereCount [ InvitationExpiresAt <. Just now ]
|
|
$logInfoS "PruneInvitations" [st|Deleted #{n} expired invitations|] |