Skip to content

Commit

Permalink
Increase subscription buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberboss committed Oct 3, 2024
1 parent d24abb5 commit 9d2b1d5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Tgstation.Server.Host/Core/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Elastic.CommonSchema.Serilog;

using HotChocolate.AspNetCore;
using HotChocolate.Subscriptions;
using HotChocolate.Types;

using Microsoft.AspNetCore.Authentication;
Expand Down Expand Up @@ -296,7 +297,7 @@ void ConfigureNewtonsoftJsonSerializerSettingsForApi(JsonSerializerSettings sett
// configure graphql
if (postSetupServices.InternalConfiguration.EnableGraphQL)
services
.AddScoped<ITopicEventReceiver, ShutdownAwareTopicEventReceiver>()
.AddScoped<GraphQL.Subscriptions.ITopicEventReceiver, ShutdownAwareTopicEventReceiver>()
.AddGraphQLServer()
.AddAuthorization()
.ModifyOptions(options =>
Expand All @@ -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 =>
Expand Down

0 comments on commit 9d2b1d5

Please sign in to comment.