Skip to content

Commit

Permalink
修正 eval 代码
Browse files Browse the repository at this point in the history
  • Loading branch information
huangzworks committed Apr 21, 2012
1 parent a2aad27 commit 2b4844f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions script/eval.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ Redis 提供了以下几个 SCRIPT 命令,用于对脚本子系统(scripting s

RandomPushScript = <<EOF
local i = tonumber(ARGV[1])
local res
while (i > 0) do
res = redis.call('lpush',KEYS[1],math.random())
i = i-1
Expand Down Expand Up @@ -243,6 +244,7 @@ Redis 提供了以下几个 SCRIPT 命令,用于对脚本子系统(scripting s

RandomPushScript = <<EOF
local i = tonumber(ARGV[1])
local res
math.randomseed(tonumber(ARGV[2]))
while (i > 0) do
res = redis.call('lpush',KEYS[1],math.random())
Expand Down

0 comments on commit 2b4844f

Please sign in to comment.