🐛 Fix wrong queue name

This commit is contained in:
2025-08-24 13:19:39 +08:00
parent 7cb14940d9
commit d9a5fed77f
2 changed files with 4 additions and 6 deletions

View File

@@ -16,8 +16,8 @@ public class QueueBackgroundService(
)
: BackgroundService
{
private const string QueueName = "pusher.queue";
private const string QueueGroup = "pusher.workers";
public const string QueueName = "pusher.queue";
public const string QueueGroup = "pusher.workers";
private readonly int _consumerCount = configuration.GetValue<int?>("ConsumerCount") ?? Environment.ProcessorCount;
private readonly List<Task> _consumerTasks = [];

View File

@@ -6,8 +6,6 @@ namespace DysonNetwork.Pusher.Services;
public class QueueService(INatsConnection nats)
{
private const string QueueName = "pusher_queue";
public async Task EnqueueEmail(string toName, string toAddress, string subject, string body)
{
var message = new QueueMessage
@@ -22,7 +20,7 @@ public class QueueService(INatsConnection nats)
})
};
var rawMessage = GrpcTypeHelper.ConvertObjectToByteString(message).ToByteArray();
await nats.PublishAsync(QueueName, rawMessage);
await nats.PublishAsync(QueueBackgroundService.QueueName, rawMessage);
}
public async Task EnqueuePushNotification(Notification.Notification notification, Guid userId, bool isSavable = false)
@@ -37,7 +35,7 @@ public class QueueService(INatsConnection nats)
Data = JsonSerializer.Serialize(notification)
};
var rawMessage = GrpcTypeHelper.ConvertObjectToByteString(message).ToByteArray();
await nats.PublishAsync(QueueName, rawMessage);
await nats.PublishAsync(QueueBackgroundService.QueueName, rawMessage);
}
}