PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, September 5, 2022

[FIXED] Why I keep getting this error " Wrong number of args calling Redis command From Lua script" even I get desired output

 September 05, 2022     lua, python, redis     No comments   

Issue

I trying to execute this lua script i get proper output too. But i keep getting 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])

Solution

Maybe it is just a typo and has already been corrected but:

self.exectute shouldn't it be self.execute?



Answered By - Ignacio
Answer Checked By - Katrina (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,213,160

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing