请问下面的代码中如果 ExecuteOperation(op) 执行超时,会发生什么情况?
IOperationResult IMemcachedNode.Execute(IOperation op)
{
var cts = new CancellationTokenSource();
cts.CancelAfter(timeout);
void Cancel()
{
_logger.LogWarning($"Timeout to {nameof(IMemcachedNode.Execute)}({op})");
}
cts.Token.Register(Cancel);
return ExecuteOperation(op);
}
return ExecuteOperation(op);
和cts都没啥关系呀,代码漏写了?
这样子? return ExecuteOperation(op,cts.token);