You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1019,21 +1020,39 @@ deleteSndMsgDelivery db connId SndQueue {dbQueueId} msgId keepForReceipt = do
1019
1020
db
1020
1021
"DELETE FROM snd_message_deliveries WHERE conn_id = ? AND snd_queue_id = ? AND internal_id = ?"
1021
1022
(connId, dbQueueId, msgId)
1022
-
cnt <- countPendingSndDeliveries_ db connId msgId
1023
-
when (cnt ==0) $do
1024
-
maybeFirstRow id (DB.query db "SELECT rcpt_internal_id, rcpt_status, snd_message_body_id FROM snd_messages WHERE conn_id = ? AND internal_id = ?" (connId, msgId)) >>=\case
1025
-
Just (Just (_ ::Int64), JustMROk, sndMsgBodyId_) ->do
1026
-
forM_ sndMsgBodyId_ deleteSndMsgBody
1027
-
deleteMsg db connId msgId
1028
-
Just (_, _, Just (sndMsgBodyId ::Int64)) ->do
1029
-
deleteSndMsgBody sndMsgBodyId
1030
-
delKeepForReceipt
1031
-
_ ->
1032
-
delKeepForReceipt
1023
+
getRcptAndBodyId >>=mapM_ deleteMsgAndBody
1033
1024
where
1034
-
delKeepForReceipt =if keepForReceipt then deleteMsgContent db connId msgId else deleteMsg db connId msgId
1035
-
deleteSndMsgBody sndMsgBodyId =
1036
-
DB.execute db "DELETE FROM snd_message_bodies WHERE snd_message_body_id = ?" (Only sndMsgBodyId)
0 commit comments