From 98f3000794e932d4e3266d2d23b84557471f465d Mon Sep 17 00:00:00 2001 From: Loretta Date: Thu, 9 Apr 2026 08:28:56 +0200 Subject: [PATCH] Update DB to DEV and customize AyCodeBinaryHubProtocol DI Changed connection string to use FruitBank_DEV database. Updated DI registration of AyCodeBinaryHubProtocol to use custom AcBinarySerializerOptions with BufferWriterChunkSize set to 4096. Added import for AyCode.Core.Serializers.Binaries and included a commented alternative DI approach. --- .../Infrastructure/PluginNopStartup.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Nop.Plugin.Misc.AIPlugin/Infrastructure/PluginNopStartup.cs b/Nop.Plugin.Misc.AIPlugin/Infrastructure/PluginNopStartup.cs index c61b609..b1001a1 100644 --- a/Nop.Plugin.Misc.AIPlugin/Infrastructure/PluginNopStartup.cs +++ b/Nop.Plugin.Misc.AIPlugin/Infrastructure/PluginNopStartup.cs @@ -36,6 +36,7 @@ using Nop.Web.Areas.Admin.Factories; using Nop.Web.Areas.Admin.Models.Catalog; using Nop.Web.Areas.Admin.Models.Orders; using System.Net.Http.Headers; +using AyCode.Core.Serializers.Binaries; namespace Nop.Plugin.Misc.FruitBankPlugin.Infrastructure; @@ -152,7 +153,16 @@ public class PluginNopStartup : INopStartup //hubOptions.HandshakeTimeout = TimeSpan.FromSeconds(15); //default timeout is 15 seconds }); - services.AddSingleton(new AyCodeBinaryHubProtocol()); + services.AddSingleton(sp => + { + var binaryOptions = AcBinarySerializerOptions.Default; + binaryOptions.BufferWriterChunkSize = 4096; + + return new AyCodeBinaryHubProtocol(binaryOptions); + }); + + //Vagy ha az options-t is DI-ből: + //hubBuilder.Services.AddSingleton(sp => new AyCodeBinaryHubProtocol(sp.GetRequiredService())); } ///