Fix: PaymentRequest get expired even if paid on time

This commit is contained in:
nicolas.dorier
2025-04-09 18:47:10 +09:00
parent 5df2ffe689
commit ba9646f486
4 changed files with 22 additions and 17 deletions

View File

@@ -22,6 +22,8 @@ namespace BTCPayServer.Services
var due = ExecuteAt - DateTimeOffset.UtcNow;
if (due < TimeSpan.Zero)
due = TimeSpan.Zero;
else
due += TimeSpan.FromSeconds(1.0); // Better to be a bit late than too early
// Max timer needed, else dotnet crash
if (due > MaxTimer)
due = MaxTimer;
@@ -61,7 +63,7 @@ namespace BTCPayServer.Services
var s = (TimerState)state!;
Task.Run(async () =>
{
bool run = s.NextWait() == TimeSpan.Zero;
bool run = s.NextWait() < TimeSpan.FromSeconds(5.0);
try
{
if (run)