🐛 Make send notification await

This commit is contained in:
2025-08-16 00:03:41 +08:00
parent 924e31aad5
commit 7fb199b187
2 changed files with 5 additions and 6 deletions

View File

@@ -3,7 +3,6 @@ using CorePush.Firebase;
using DysonNetwork.Pusher.Connection;
using DysonNetwork.Shared.Cache;
using DysonNetwork.Shared.Proto;
using EFCore.BulkExtensions;
using Microsoft.EntityFrameworkCore;
using NodaTime;
@@ -111,7 +110,7 @@ public class PushService
return subscription;
}
public void SendNotification(Account account,
public async Task SendNotification(Account account,
string topic,
string? title = null,
string? subtitle = null,
@@ -141,7 +140,7 @@ public class PushService
if (save)
_fbs.Enqueue(notification);
if (!isSilent) _ = DeliveryNotification(notification);
if (!isSilent) await DeliveryNotification(notification);
}
private async Task DeliveryNotification(Notification notification)
@@ -337,4 +336,4 @@ public class PushService
_logger.LogInformation(
$"Successfully pushed notification #{notification.Id} to device {subscription.DeviceId} provider {subscription.Provider}");
}
}
}