sqlsugar偶发线程故障,添加copyNew方法

This commit is contained in:
2248356998 qq.com
2023-06-28 18:54:45 +08:00
parent a05ce86dd7
commit 7733cf5bf0
4 changed files with 7 additions and 7 deletions

View File

@@ -105,7 +105,7 @@ namespace ThingsGateway.Application
if (desc == null)
{
var taskT = method.Invoke(Target, args) as Task<T>;
var result = await taskT;//如果没有缓存就执行方法返回数据
var result = await taskT;
return result;//返回结果
}
else
@@ -116,7 +116,7 @@ namespace ThingsGateway.Application
try
{
var taskT = method.Invoke(Target, args) as Task<T>;
result = await taskT;//如果没有缓存就执行方法返回数据
result = await taskT;
}
catch (Exception ex)
{

View File

@@ -148,7 +148,7 @@ namespace ThingsGateway.Application.Services.Auth
});
//登录事件参数
var logingEvent = new LoginEvent
var loginEvent = new LoginEvent
{
Ip = App.HttpContext.GetRemoteIpAddressToIPv4(),
Device = device,
@@ -157,9 +157,9 @@ namespace ThingsGateway.Application.Services.Auth
VerificatId = sessionid,
};
await WriteVerificatToCache(logingEvent);//写入verificat到cache
await WriteVerificatToCache(loginEvent);//写入verificat到cache
await _eventPublisher.PublishAsync(EventSubscriberConst.Login, logingEvent); //发布登录事件总线
await _eventPublisher.PublishAsync(EventSubscriberConst.Login, loginEvent); //发布登录事件总线
return new LoginOutPut { VerificatId = sessionid, Account = sysUser.Account };
}

View File

@@ -89,7 +89,7 @@ namespace ThingsGateway.Application
if (sysResources == null)
{
//cache没有就去数据库拿
sysResources = await base.GetListAsync(it => it.Category == category);
sysResources = await CopyNew().GetListAsync(it => it.Category == category);
if (sysResources.Count > 0)
{
//插入Cache

View File

@@ -12,7 +12,7 @@
@page "/login"
@layout BaseLayout
@inherits CultureLayoutComponentBase
@inherits CultureComponentBase
@namespace ThingsGateway.Web.Rcl
@using BlazorComponent;
@using Masa.Blazor.Presets;