Make the NotificationSender more generic

This commit is contained in:
nicolas.dorier
2020-06-15 16:45:29 +09:00
parent 43a99bfef2
commit 9070b475ea
6 changed files with 64 additions and 48 deletions

View File

@@ -10,6 +10,7 @@ using BTCPayServer.HostedServices;
using BTCPayServer.Models.NotificationViewModels;
using BTCPayServer.Security;
using BTCPayServer.Services.Notifications;
using BTCPayServer.Services.Notifications.Blobs;
using Google;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
@@ -57,9 +58,7 @@ namespace BTCPayServer.Controllers
[HttpGet]
public async Task<IActionResult> Generate(string version)
{
await _notificationSender.NoticeNewVersionAsync(version);
// waiting for event handler to catch up
await Task.Delay(500);
await _notificationSender.SendNotification(new AdminScope(), new NewVersionNotification(version));
return RedirectToAction(nameof(Index));
}