Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Lock method does not work #20

Description

@RafaelAcostaQ2

Hi,
I'm not sure what am I doing wrong but I haven't being able to use this package. It is exactly what I need but for some reason it throws an error when I try to lock a resource.

redis_version:2.4.10

python version 3.5.2

This is my code

from redlock import Redlock
dlm = Redlock([{"host": "REDIS_SERVER_IP", "port": 6379, "db": 0}, ])

Acquire lock for 1 minute

my_lock = dlm.lock("this_is_my_key",1000)

ERROR:root:Error unlocking resource this_is_my_key in server StrictRedis<ConnectionPool<Connection<host=X.X.X.X,port=6379,db=0>>>
Traceback (most recent call last):
File "/home/redis/apps/Proj/env/lib/python3.5/site-packages/redlock/init.py", line 80, in unlock_instance
server.eval(self.unlock_script, 1, resource, val)
File "/home/redis/apps/Proj/env/lib/python3.5/site-packages/redis/client.py", line 1932, in eval
return self.execute_command('EVAL', script, numkeys, *keys_and_args)
File "/home/redis/apps/Proj/env/lib/python3.5/site-packages/redis/client.py", line 573, in execute_command
return self.parse_response(connection, command_name, **options)
File "/home/redis/apps/Proj/env/lib/python3.5/site-packages/redis/client.py", line 585, in parse_response
response = connection.read_response()
File "/home/redis/apps/Proj/env/lib/python3.5/site-packages/redis/connection.py", line 582, in read_response
raise response
redis.exceptions.ResponseError: unknown command 'EVAL'

Thanks in advanced!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions