Attempt to solve webhooks disappearing (#2178)

This commit is contained in:
Nicolas Dorier
2021-01-05 12:38:12 +09:00
committed by GitHub
parent aaf85216eb
commit 0929857b12
3 changed files with 64 additions and 43 deletions

View File

@@ -86,6 +86,8 @@ namespace BTCPayServer.HostedServices
public async Task<string> Redeliver(string deliveryId)
{
var deliveryRequest = await CreateRedeliveryRequest(deliveryId);
if (deliveryRequest is null)
return null;
EnqueueDelivery(deliveryRequest);
return deliveryRequest.Delivery.Id;
}
@@ -208,8 +210,8 @@ namespace BTCPayServer.HostedServices
try
{
var ctx = originalCtx;
var wh = (await StoreRepository.GetWebhook(ctx.WebhookId)).GetBlob();
if (!ShouldDeliver(ctx.WebhookEvent.Type, wh))
var wh = (await StoreRepository.GetWebhook(ctx.WebhookId))?.GetBlob();
if (wh is null || !ShouldDeliver(ctx.WebhookEvent.Type, wh))
continue;
var result = await SendDelivery(ctx);
if (ctx.WebhookBlob.AutomaticRedelivery &&