using System.Reflection; using FLSSL.Hubs; using GB5Shared.DaprCache; using GB5Shared.EventLogPublish; using GB5Shared.Hosting; namespace FLSSL; public class FLSModule : IModule { public void Register(IServiceCollection services, IConfiguration configuration) { services.AddSignalR(options => { options.EnableDetailedErrors = true; options.MaximumReceiveMessageSize = 32 * 1024; options.ClientTimeoutInterval = TimeSpan.FromSeconds(60); options.KeepAliveInterval = TimeSpan.FromSeconds(15); }); services.AddScoped(); services.AddScoped(); services.AddHttpClient("FlsBridge").SetHandlerLifetime(TimeSpan.FromMinutes(5)); services.AddHttpClient("Dapr").SetHandlerLifetime(TimeSpan.FromMinutes(5)); var bll = Assembly.Load("FLSBLL"); var dal = Assembly.Load("FLSDAL"); services.Scan(scan => scan .FromAssemblies(bll, dal) .AddClasses(c => c.Where(t => !t.IsAbstract && !t.IsInterface && t.GetMethod("$") == null && !typeof(Exception).IsAssignableFrom(t))) .AsImplementedInterfaces() .WithScopedLifetime()); } public void MapEndpoints(WebApplication app) { app.MapHub("/hubs/fls-monitor"); } }