Skip to content

Commit

Permalink
Do not use script load by default for envoy compat (#23)
Browse files Browse the repository at this point in the history
dlunch authored Jan 3, 2025
1 parent c9717b5 commit ee51d2d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions redis/commands/core.py
Original file line number Diff line number Diff line change
@@ -5021,9 +5021,7 @@ def __call__(
except NoScriptError:
# Maybe the client is pointed to a different server than the client
# that created this instance?
# Overwrite the sha just in case there was a discrepancy.
self.sha = client.script_load(self.script)
return client.evalsha(self.sha, len(keys), *args)
return client.eval(self.script, len(keys), *args)


class AsyncScript:
@@ -5821,9 +5819,7 @@ def __call__(self, keys=[], args=[], client=None):
except NoScriptError:
# Maybe the client is pointed to a different server than the client
# that created this instance?
# Overwrite the sha just in case there was a discrepancy.
self.sha = client.script_load(self.script)
return client.evalsha(self.sha, len(keys), *args)
return client.eval(self.script, len(keys), *args)

def get_encoder(self):
"""Get the encoder to encode string scripts into bytes."""

0 comments on commit ee51d2d

Please sign in to comment.