Skip to content

Commit 725fa1e

Browse files
committed
Use RepeatableRead for webhooks to reduce duplicate calls
1 parent 557ff5f commit 725fa1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Share/BackgroundJobs/Webhooks/Worker.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ worker scope = do
103103
toIO <- UnliftIO.askRunInIO
104104
-- Need to unlift so we can use this in transactions
105105
let tryWebhookIO eventData webhookId = toIO $ tryWebhook eventData webhookId
106-
mayResult <- Metrics.recordWebhookSendingDuration $ PG.runTransaction $ runMaybeT $ do
106+
mayResult <- Metrics.recordWebhookSendingDuration $ PG.runTransactionMode PG.ReadCommitted PG.ReadWrite $ runMaybeT $ do
107107
webhookInfo@(eventId, webhookId) <- MaybeT WQ.getUnsentWebhook
108108
mayErr <- lift $ attemptWebhookSend authZReceipt tryWebhookIO eventId webhookId
109109
pure (mayErr, webhookInfo)

0 commit comments

Comments
 (0)