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.
This commit is contained in:
parent
0d446c26df
commit
98f3000794
|
|
@ -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<IHubProtocol>(new AyCodeBinaryHubProtocol());
|
||||
services.AddSingleton<IHubProtocol>(sp =>
|
||||
{
|
||||
var binaryOptions = AcBinarySerializerOptions.Default;
|
||||
binaryOptions.BufferWriterChunkSize = 4096;
|
||||
|
||||
return new AyCodeBinaryHubProtocol(binaryOptions);
|
||||
});
|
||||
|
||||
//Vagy ha az options-t is DI-ből:
|
||||
//hubBuilder.Services.AddSingleton<IHubProtocol>(sp => new AyCodeBinaryHubProtocol(sp.GetRequiredService<AcBinarySerializerOptions>()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue