From 9d2b1d520a41b9c7f2c23fdc0011dcb2ab2a959e Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Wed, 2 Oct 2024 20:38:12 -0400 Subject: [PATCH] Increase subscription buffers --- src/Tgstation.Server.Host/Core/Application.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Tgstation.Server.Host/Core/Application.cs b/src/Tgstation.Server.Host/Core/Application.cs index fc201f72cc..aa7753c05c 100644 --- a/src/Tgstation.Server.Host/Core/Application.cs +++ b/src/Tgstation.Server.Host/Core/Application.cs @@ -9,6 +9,7 @@ using Elastic.CommonSchema.Serilog; using HotChocolate.AspNetCore; +using HotChocolate.Subscriptions; using HotChocolate.Types; using Microsoft.AspNetCore.Authentication; @@ -296,7 +297,7 @@ void ConfigureNewtonsoftJsonSerializerSettingsForApi(JsonSerializerSettings sett // configure graphql if (postSetupServices.InternalConfiguration.EnableGraphQL) services - .AddScoped() + .AddScoped() .AddGraphQLServer() .AddAuthorization() .ModifyOptions(options => @@ -311,7 +312,11 @@ void ConfigureNewtonsoftJsonSerializerSettingsForApi(JsonSerializerSettings sett }) #endif .AddMutationConventions() - .AddInMemorySubscriptions() + .AddInMemorySubscriptions( + new SubscriptionOptions + { + TopicBufferCapacity = 1024, // mainly so high for tests, not possible to DoS the server without authentication and some other access to generate messages + }) .AddGlobalObjectIdentification() .AddQueryFieldToMutationPayloads() .ModifyOptions(options =>