#步骤(How to use it)
- 保存脚本到(Save script as ) redis_size.lua
- 注册脚本 (Load script)
redis-cli -h 192.168.1.1 -p 6371 script load "$(cat redis_size.lua)"
- 调用(Call it)
evalsha 78331e1d4741cad34084d357e19ce6dbca8e202e 0 test_key // 注意与上步返回的一致
import sys | |
def calculate(params, tm): | |
ex_stack = [] | |
tmp = [] | |
mutil = [] | |
for p in params: | |
if (not p): | |
continue |
#步骤(How to use it)
redis-cli -h 192.168.1.1 -p 6371 script load "$(cat redis_size.lua)"
evalsha 78331e1d4741cad34084d357e19ce6dbca8e202e 0 test_key // 注意与上步返回的一致