python - 为什么即使我获得了所需的输出,我仍会收到此错误 "Wrong number of args calling Redis command From Lua script"

标签 python lua redis

我试图执行这个 lua 脚本,我也得到了正确的输出。但是我不断收到 Wrong number of args calling Redis command From Lua script

def new_get_following(self, start, count, user_id=0):
        script = """
        local envs = redis.call('zrevrange',KEYS[1],ARGV[3],ARGV[4]);
        redis.call('sadd',ARGV[1],unpack(envs));
        local favs = redis.call('sinter',ARGV[2],ARGV[1]);
        local acts= redis.call('mget',unpack(envs));
        redis.call('del',ARGV[1]);
        return {favs,envs,acts}
        """
        count = int(start) + int(count) - 1
        print count
        fav_key = self.fav_key + ":" + str(user_id)
        following_stream_key = self.following_stream_key + ":" + str(user_id)
        tmp_key = int(time.time())
        return self.exectute(script, args=[tmp_key, fav_key, start, count], keys=[following_stream_key])

最佳答案

也许这只是一个打字错误并且已经更正但是:

self.execute 不应该是self.execute吗?

关于python - 为什么即使我获得了所需的输出,我仍会收到此错误 "Wrong number of args calling Redis command From Lua script",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31006382/

相关文章:

python - 高效地对 pandas 列的多个子集进行回归分析

python - 使用 Keras 使用多个指标进行预测

functional-programming - 命名函数和匿名函数(Lua)之间的区别

lua - 捕获对 Lua 中不存在函数的调用

database - 有什么有效的方法可以减少 HyperLogLog ( redis ) 中的错误?

python - 调整 celery 以获得高性能

python - 如何将 +1 添加到函数之间的值

lua - 在redis中加载lua脚本文件

ruby-on-rails - 用于 Rails 的 Phusion Passenger 应用程序预加载器

redis - 无法在 spring-data-redis 事务中查询列表