mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2025-12-17 15:44:26 +01:00
handle cancellation
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Product>Nostr </Product>
|
<Product>Nostr </Product>
|
||||||
<Description>Allows you to verify your nostr account with NIP5 and zap like the rest of the crazies</Description>
|
<Description>Allows you to verify your nostr account with NIP5 and zap like the rest of the crazies</Description>
|
||||||
<Version>1.0.6</Version>
|
<Version>1.0.7</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<!-- Plugin development properties -->
|
<!-- Plugin development properties -->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class LnurlDescriptionFilter : PluginHookFilter<string>
|
|||||||
return arg;
|
return arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
var entry = _memoryCache.CreateEntry(Nip05Plugin.GetZapRequestCacheKey(invoiceId.ToString()));
|
using var entry = _memoryCache.CreateEntry(Nip05Plugin.GetZapRequestCacheKey(invoiceId.ToString()));
|
||||||
entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(5);
|
entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(5);
|
||||||
entry.SetAbsoluteExpiration(TimeSpan.FromMinutes(5));
|
entry.SetAbsoluteExpiration(TimeSpan.FromMinutes(5));
|
||||||
entry.SetValue(nostr);
|
entry.SetValue(nostr);
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ public class Zapper : IHostedService
|
|||||||
{
|
{
|
||||||
while (!cancellationToken.IsCancellationRequested)
|
while (!cancellationToken.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (_pendingZapEvents.Any())
|
if (_pendingZapEvents.Any())
|
||||||
{
|
{
|
||||||
_logger.LogInformation($"Attempting to send {_pendingZapEvents.Count} zap receipts");
|
_logger.LogInformation($"Attempting to send {_pendingZapEvents.Count} zap receipts");
|
||||||
@@ -94,7 +93,15 @@ public class Zapper : IHostedService
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Task.Delay(100, waitingToken.Token);
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
await Task.Delay(100, waitingToken.Token);
|
||||||
|
}
|
||||||
|
catch (TaskCanceledException e)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user