MCPcopy Create free account
hub / github.com/cc20110101/RedisView / scriptflush

Method scriptflush

src/RedisView/RedisLib/RedisClient.cpp:3632–3659  ·  view source on GitHub ↗

* 清除所有Lua脚本缓存 * @return 成功true,失败false * @see * @note */

Source from the content-addressed store, hash-verified

3630 * @note
3631 */
3632bool RedisClient::scriptflush() {
3633 _sErrorInfo.clear();
3634 _cmd.clear();
3635 _cmd.append("SCRIPT FLUSH");
3636
3637 _cmdResult = command(_cmd);
3638 if(_cmdResult[0] == '-') {
3639 if(parseRespError(_cmdResult,_sValue))
3640 _sErrorInfo = _sValue;
3641 else
3642 _sErrorInfo = "parser resp error info failed";
3643 _bRet = false;
3644 } else if(_cmdResult[0] == '+') {
3645 if(parseRespString(_cmdResult,_sValue)) {
3646 if(_sValue == "OK")
3647 _bRet = true;
3648 else
3649 _bRet = false;
3650 } else {
3651 _sErrorInfo = "parser resp string info failed";
3652 _bRet = false;
3653 }
3654 } else {
3655 _bRet = false;
3656 _sErrorInfo = QString("parser resp type failed:") + _cmdResult[0];
3657 }
3658 return _bRet;
3659}
3660
3661/**
3662 * 杀死当前正在运行的Lua脚本,当且仅当这个脚本没有执行过任何写操作时,这个命令才生效。

Callers

nothing calls this directly

Calls 2

appendMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected