提交 e7f28a6e 编写于 作者: lzc828's avatar lzc828

协程内抛出错误

上级 562cd9ff
...@@ -20,11 +20,11 @@ class Model extends ArrayModel ...@@ -20,11 +20,11 @@ class Model extends ArrayModel
protected $_cache_time = 600; protected $_cache_time = 600;
protected $_cache_column = []; protected $_cache_key_column = [];
protected $_ignore_flush_cache_column = []; protected $_ignore_flush_cache_column = [];
protected $_relation = null; private $_relation = null;
CONST TABLE = ''; CONST TABLE = '';
...@@ -48,8 +48,8 @@ class Model extends ArrayModel ...@@ -48,8 +48,8 @@ class Model extends ArrayModel
if ($this->_cache_time > 0) { if ($this->_cache_time > 0) {
$this->_build->cache($this->_cache_time); $this->_build->cache($this->_cache_time);
} }
if ($this->_cache_column) { if ($this->_cache_key_column) {
$this->_build->cacheColumn($this->_cache_column); $this->_build->cacheColumn($this->_cache_key_column);
} }
if ($this->_ignore_flush_cache_column) { if ($this->_ignore_flush_cache_column) {
$this->_build->ignoreColumn($this->_ignore_flush_cache_column); $this->_build->ignoreColumn($this->_ignore_flush_cache_column);
......
...@@ -186,11 +186,18 @@ function one_go($call) ...@@ -186,11 +186,18 @@ function one_go($call)
{ {
if (_CLI_) { if (_CLI_) {
$co_id = get_co_id(); $co_id = get_co_id();
return \One\Facades\Log::bindTraceId(go(function () use ($call, $co_id) { return \One\Facades\Log::bindTraceId(go(function () use ($call, $co_id, &$el) {
\One\Facades\Log::bindTraceId($co_id, true); \One\Facades\Log::bindTraceId($co_id, true);
$call(); try {
$call();
} catch (\Throwable $e) {
$el = $e;
}
Log::flushTraceId(); Log::flushTraceId();
})); }));
if ($el) {
throw $el;
}
} else { } else {
return $call(); return $call();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册