From 8f09a165e27ca0e4af746966467bcec9bd0d7902 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 1 Dec 2017 08:02:40 -0500 Subject: [PATCH] add delay for webhook race condition --- src/Billing/Controllers/BraintreeController.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Billing/Controllers/BraintreeController.cs b/src/Billing/Controllers/BraintreeController.cs index 0ba7cac04e..f3de1e3f0f 100644 --- a/src/Billing/Controllers/BraintreeController.cs +++ b/src/Billing/Controllers/BraintreeController.cs @@ -95,6 +95,10 @@ namespace Bit.Billing.Controllers } else { + // A race condition is happening between the time of purchase and receiving this webhook. Add some + // artificial delay here to help combat that. + await Task.Delay(2000); + // org if(ids.Item1.HasValue) {