提交 e635f643 编写于 作者: W wq1234wq

缓存

上级 ac2c1c95
......@@ -62,6 +62,7 @@ namespace IoTSharp.Controllers
SignInManager<IdentityUser> signInManager, ILogger<DevicesController> logger, MqttServer serverEx, ApplicationDbContext context, MqttClientOptions mqtt, IStorage storage, IOptions<AppSettings> options, ICapPublisher queue
, IEasyCachingProviderFactory factory, FlowRuleProcessor flowRuleProcessor, IServiceScopeFactory scopeFactor)
{
string _hc_Caching = $"{nameof(CachingUseIn)}-{Enum.GetName(options.Value.CachingUseIn)}";
_context = context;
_mqtt = mqtt;
_userManager = userManager;
......@@ -72,7 +73,7 @@ namespace IoTSharp.Controllers
_setting = options.Value;
_queue = queue;
_flowRuleProcessor = flowRuleProcessor;
_caching = factory.GetCachingProvider("iotsharp");
_caching = factory.GetCachingProvider(_hc_Caching);
_scopeFactor = scopeFactor;
}
......
......@@ -32,13 +32,15 @@ namespace IoTSharp.FlowRuleEngine
public FlowRuleProcessor(ILogger<FlowRuleProcessor> logger, IServiceScopeFactory scopeFactor, IOptions<AppSettings> options, TaskExecutorHelper helper, IEasyCachingProviderFactory factory)
{
string _hc_Caching = $"{nameof(CachingUseIn)}-{Enum.GetName(options.Value.CachingUseIn)}";
_scopeFactor = scopeFactor;
_logger = logger;
_setting = options.Value;
_allFlows = new List<Flow>();
_allflowoperation = new List<FlowOperation>();
_helper = helper;
_caching = factory.GetCachingProvider("iotsharp");
_caching = factory.GetCachingProvider(_hc_Caching);
_sp = _scopeFactor.CreateScope().ServiceProvider;
}
......
......@@ -43,11 +43,12 @@ namespace IoTSharp.Gateways
, ApplicationDbContext context
)
{
string _hc_Caching = $"{nameof(CachingUseIn)}-{Enum.GetName(options.Value.CachingUseIn)}";
_setting = options.Value;
_logger = logger;
_queue = queue;
_scopeFactor = scopeFactor;
_caching = factory.GetCachingProvider("iotsharp");
_caching = factory.GetCachingProvider(_hc_Caching);
_context = context;
}
......
......@@ -36,12 +36,13 @@ namespace IoTSharp.Handlers
, IOptions<AppSettings> options, IStorage storage, FlowRuleProcessor flowRuleProcessor, IEasyCachingProviderFactory factory
)
{
string _hc_Caching = $"{nameof(CachingUseIn)}-{Enum.GetName(options.Value.CachingUseIn)}";
_appSettings = options.Value;
_logger = logger;
_scopeFactor = scopeFactor;
_storage = storage;
_flowRuleProcessor = flowRuleProcessor;
_caching = factory.GetCachingProvider("iotsharp");
_caching = factory.GetCachingProvider(_hc_Caching);
}
[CapSubscribe("iotsharp.services.datastream.attributedata")]
......
......@@ -40,6 +40,7 @@ namespace IoTSharp.Handlers
, IOptions<AppSettings> options, ICapPublisher queue, IEasyCachingProviderFactory factory, FlowRuleProcessor flowRuleProcessor
)
{
string _hc_Caching = $"{nameof(CachingUseIn)}-{Enum.GetName(options.Value.CachingUseIn)}";
_mcsetting = options.Value.MqttClient;
_settings = options.Value;
_logger = logger;
......@@ -48,7 +49,7 @@ namespace IoTSharp.Handlers
_serverEx = serverEx;
_queue = queue;
_flowRuleProcessor = flowRuleProcessor;
_caching = factory.GetCachingProvider("iotsharp");
_caching = factory.GetCachingProvider(_hc_Caching);
}
static long clients = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册