mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-29 10:49:36 +08:00
Quartz.net special special case problem
This commit is contained in:
parent
84af1f46ce
commit
40e5ab964d
@ -20,13 +20,21 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
SqlSugarClient result = null;
|
SqlSugarClient result = null;
|
||||||
var key = _configs.GetHashCode().ToString();
|
var key = _configs.GetHashCode().ToString();
|
||||||
if (Task.CurrentId != null)
|
|
||||||
{
|
|
||||||
key= $"{key}Task";
|
|
||||||
}
|
|
||||||
StackTrace st = new StackTrace(true);
|
StackTrace st = new StackTrace(true);
|
||||||
var methods = st.GetFrames();
|
var methods = st.GetFrames();
|
||||||
var isAsync = UtilMethods.IsAnyAsyncMethod(methods);
|
var isAsync = UtilMethods.IsAnyAsyncMethod(methods);
|
||||||
|
if (Task.CurrentId != null)
|
||||||
|
{
|
||||||
|
foreach (var method in methods)
|
||||||
|
{
|
||||||
|
var methodInfo = method.GetMethod();
|
||||||
|
if (methodInfo.Name== "MoveNext"&& methodInfo.ReflectedType.FullName.StartsWith("Quartz."))
|
||||||
|
{
|
||||||
|
key = $"{key}Quartz";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (isAsync)
|
if (isAsync)
|
||||||
{
|
{
|
||||||
result = GetAsyncContext(key);
|
result = GetAsyncContext(key);
|
||||||
|
Loading…
Reference in New Issue
Block a user