修复监控bug
This commit is contained in:
@@ -233,7 +233,9 @@ namespace MonitorModule.ViewModels
|
||||
.Where(m =>
|
||||
{
|
||||
if (m.GetCustomAttribute<MonitorableAttribute>() == null) return false;
|
||||
if (m.ReturnType != typeof(Task<string>)) return false;
|
||||
// 同时支持 Task<string> 和 Task<double> 返回类型
|
||||
var rt = m.ReturnType;
|
||||
if (rt != typeof(Task<string>) && rt != typeof(Task<double>)) return false;
|
||||
var parms = m.GetParameters();
|
||||
return parms.Length == 0 ||
|
||||
(parms.Length == 1 && parms[0].ParameterType == typeof(CancellationToken));
|
||||
|
||||
Reference in New Issue
Block a user