Skip to content

The keyDB instance is called redis in lua #594

@merlinthemagic

Description

@merlinthemagic

Hi,

Likely not an oversight, since there are several issues regarding lua scripts that happily refer to the KeyDB instance as redis.
But the documentation says otherwise, so i thought i would note it.

version: keydb-6.3.2-1.el7.x86_64
OS: CentOS7

Docs: https://docs.keydb.dev/docs/distlock/#correct-implementation-with-a-single-instance

From article:

if KeyDB.call("get",KEYS[1]) == ARGV[1] then
return KeyDB.call("del",KEYS[1])
else
return 0
end

Result is the server floating the following error:

@enable_strict_lua:15: user_script:1: Script attempted to access nonexistent global variable 'KeyDB'

Change the referance from KeyDB to redis and the script executes as expected.

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