Add SQL outbox for MAX sends
This commit is contained in:
@@ -95,7 +95,9 @@ builder.Services.AddScoped<ChatProjectionService>();
|
||||
builder.Services.AddScoped<IPushNotificationService, FirebasePushNotificationService>();
|
||||
builder.Services.AddSingleton<IAttachmentStorageService, AttachmentStorageService>();
|
||||
builder.Services.AddSingleton<MaxBridgeSyncService>();
|
||||
builder.Services.AddScoped<MaxOutboxService>();
|
||||
builder.Services.AddHostedService<MaxSyncWorker>();
|
||||
builder.Services.AddHostedService<MaxOutboxWorker>();
|
||||
|
||||
if (string.Equals(configuredOptions.MaxMode, "Mock", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -176,6 +178,11 @@ static async Task EnsureCompatibilitySchemaAsync(QMaxDbContext db)
|
||||
ON Messages (ChatId, ExternalId);
|
||||
""");
|
||||
|
||||
await db.Database.ExecuteSqlRawAsync("""
|
||||
CREATE INDEX IF NOT EXISTS IX_Messages_DeliveryState_SentAt
|
||||
ON Messages (DeliveryState, SentAt);
|
||||
""");
|
||||
|
||||
await db.Database.ExecuteSqlRawAsync("""
|
||||
CREATE TABLE IF NOT EXISTS MessageReactions (
|
||||
Id TEXT NOT NULL CONSTRAINT PK_MessageReactions PRIMARY KEY,
|
||||
|
||||
Reference in New Issue
Block a user