This commit is contained in:
nicolas.dorier 2018-01-18 18:33:26 +09:00
parent a59edc5e8c
commit 4b7b6c6327
4 changed files with 10 additions and 4 deletions

View File

@ -51,7 +51,7 @@ namespace BTCPayServer.Tests
// Some check that handling legacy stuff does not break things
var cryptoData = entity.GetCryptoData("BTC", null, true);
cryptoData.Calculate();
Assert.NotNull(cryptoData);
Assert.NotNull(cryptoData);
Assert.Null(entity.GetCryptoData("BTC", null, false));
entity.SetCryptoData(new CryptoData() { ParentEntity = entity, Rate = entity.Rate, CryptoCode = "BTC", TxFee = entity.TxFee });
Assert.NotNull(entity.GetCryptoData("BTC", null, false));

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<Version>1.0.1.5</Version>
<Version>1.0.1.6</Version>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Build\dockerfiles\**" />

View File

@ -412,7 +412,6 @@ namespace BTCPayServer.HostedServices
{
if (invoiceId == null)
throw new ArgumentNullException(nameof(invoiceId));
Logs.PayServer.LogInformation($"Watching {invoiceId}");
_WatchRequests.Add(invoiceId);
var invoice = await _InvoiceRepository.GetInvoice(null, invoiceId);
try
@ -457,8 +456,10 @@ namespace BTCPayServer.HostedServices
{
try
{
Logs.PayServer.LogInformation($"POLL");
foreach (var pending in await _InvoiceRepository.GetPendingInvoices())
{
Logs.PayServer.LogInformation($"POLL: {pending}");
_WatchRequests.Add(pending);
}
await Task.Delay(PollInterval, cancellation);
@ -496,7 +497,9 @@ namespace BTCPayServer.HostedServices
}
finally {
Logs.PayServer.LogInformation($"Updated {i}");
executing.TryRemove(i, out Task useless); }
if(!executing.TryRemove(i, out Task useless))
Logs.PayServer.LogInformation($"NOT REMOVED");
}
});
}
}

View File

@ -1,4 +1,5 @@
using DBreeze;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Text;
@ -16,6 +17,7 @@ using System.Threading.Tasks;
using BTCPayServer.Data;
using System.Globalization;
using BTCPayServer.Models.InvoicingModels;
using BTCPayServer.Logging;
namespace BTCPayServer.Services.Invoices
{
@ -43,6 +45,7 @@ namespace BTCPayServer.Services.Invoices
public async Task<bool> RemovePendingInvoice(string invoiceId)
{
Logs.PayServer.LogInformation($"Remove pending invoice {invoiceId}");
using (var ctx = _ContextFactory.CreateContext())
{
ctx.PendingInvoices.Remove(new PendingInvoiceData() { Id = invoiceId });