Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR wrong number of arguments for 'setnx' command #2751

Open
flamewave opened this issue Jun 27, 2024 · 0 comments
Open

ERR wrong number of arguments for 'setnx' command #2751

flamewave opened this issue Jun 27, 2024 · 0 comments

Comments

@flamewave
Copy link

When calling IDatabase.StringSet with when=When.NotExists and keepTtl=true, you are calling the "SETNX" command and also passing the KEEPTTL option, which is not supported. This should be updated to use the "SET" command with the "NX" and "KEEPTTL" options instead.

Example call:
IDatabase db = ...;
bool result = db.StringSet("key", "value", null, true, When.NotExists);

When.NotExists when keepTtl => Message.Create(Database, flags, RedisCommand.SETNX, key, value, RedisLiterals.KEEPTTL),

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

No branches or pull requests

2 participants