fix(#I136OP): 使用最原始的数据库创建方法

#Comment
comment #I136OP
防止数据库插入异常失败时导致死循环

#Issue
close https://gitee.com/LongbowEnterprise/dashboard/issues?id=I136OP
This commit is contained in:
Argo Zhang 2019-10-10 17:25:27 +08:00
parent d399fcb07e
commit e1cfda47e9
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 15 additions and 11 deletions

View File

@ -98,18 +98,22 @@ namespace Bootstrap.DataAccess
try
{
// 防止数据库写入操作失败后陷入死循环
DbManager.Create().Insert(new Exceptions
// fix https://gitee.com/LongbowEnterprise/dashboard/issues?id=I136OP
using (var db = Longbow.Data.DbManager.Create())
{
AppDomainName = AppDomain.CurrentDomain.FriendlyName,
ErrorPage = errorPage,
UserId = additionalInfo?["UserId"],
UserIp = additionalInfo?["UserIp"],
ExceptionType = ex.GetType().FullName,
Message = ex.Message,
StackTrace = ex.StackTrace,
LogTime = DateTime.Now,
Category = category
});
db.Insert(new Exceptions
{
AppDomainName = AppDomain.CurrentDomain.FriendlyName,
ErrorPage = errorPage,
UserId = additionalInfo?["UserId"],
UserIp = additionalInfo?["UserIp"],
ExceptionType = ex.GetType().FullName,
Message = ex.Message,
StackTrace = ex.StackTrace,
LogTime = DateTime.Now,
Category = category
});
}
ClearExceptions();
}
catch { }