mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +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;
|
||||
var key = _configs.GetHashCode().ToString();
|
||||
if (Task.CurrentId != null)
|
||||
{
|
||||
key= $"{key}Task";
|
||||
}
|
||||
StackTrace st = new StackTrace(true);
|
||||
var methods = st.GetFrames();
|
||||
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)
|
||||
{
|
||||
result = GetAsyncContext(key);
|
||||
|
Loading…
Reference in New Issue
Block a user