🐛 Make send notification await
This commit is contained in:
@@ -3,7 +3,6 @@ using CorePush.Firebase;
|
|||||||
using DysonNetwork.Pusher.Connection;
|
using DysonNetwork.Pusher.Connection;
|
||||||
using DysonNetwork.Shared.Cache;
|
using DysonNetwork.Shared.Cache;
|
||||||
using DysonNetwork.Shared.Proto;
|
using DysonNetwork.Shared.Proto;
|
||||||
using EFCore.BulkExtensions;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using NodaTime;
|
using NodaTime;
|
||||||
|
|
||||||
@@ -111,7 +110,7 @@ public class PushService
|
|||||||
return subscription;
|
return subscription;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendNotification(Account account,
|
public async Task SendNotification(Account account,
|
||||||
string topic,
|
string topic,
|
||||||
string? title = null,
|
string? title = null,
|
||||||
string? subtitle = null,
|
string? subtitle = null,
|
||||||
@@ -141,7 +140,7 @@ public class PushService
|
|||||||
if (save)
|
if (save)
|
||||||
_fbs.Enqueue(notification);
|
_fbs.Enqueue(notification);
|
||||||
|
|
||||||
if (!isSilent) _ = DeliveryNotification(notification);
|
if (!isSilent) await DeliveryNotification(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task DeliveryNotification(Notification notification)
|
private async Task DeliveryNotification(Notification notification)
|
||||||
|
@@ -85,7 +85,7 @@ public class PusherServiceGrpc(
|
|||||||
ServerCallContext context)
|
ServerCallContext context)
|
||||||
{
|
{
|
||||||
var account = await accountsHelper.GetAccount(Guid.Parse(request.UserId));
|
var account = await accountsHelper.GetAccount(Guid.Parse(request.UserId));
|
||||||
pushService.SendNotification(
|
await pushService.SendNotification(
|
||||||
account,
|
account,
|
||||||
request.Notification.Topic,
|
request.Notification.Topic,
|
||||||
request.Notification.Title,
|
request.Notification.Title,
|
||||||
|
Reference in New Issue
Block a user