diff options
author | Ben Greenberg <bgreenberg@eventbrite.com> | 2017-06-16 09:40:04 -0700 |
---|---|---|
committer | Ben Greenberg <bgreenberg@eventbrite.com> | 2017-06-16 09:40:04 -0700 |
commit | b4260471eb5bbf67dbaf39b0f505ddb73e68102c (patch) | |
tree | eb655fc8ca103479c6e6a8baf7772ca543098f63 | |
parent | 5fceb43c0b8685411b0aa1db884a1a60ad075c09 (diff) | |
download | redis-py-b4260471eb5bbf67dbaf39b0f505ddb73e68102c.tar.gz |
Remove script_load_for_pipeline and directly add Script object to BasePipeline.scripts
-rwxr-xr-x | redis/client.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/redis/client.py b/redis/client.py index 495ffeb..bee539a 100755 --- a/redis/client.py +++ b/redis/client.py @@ -2906,10 +2906,6 @@ class BasePipeline(object): "Unwatches all previously specified keys" return self.watching and self.execute_command('UNWATCH') or True - def script_load_for_pipeline(self, script): - "Make sure scripts can be loaded prior to pipeline execution" - self.scripts.add(script) - class StrictPipeline(BasePipeline, StrictRedis): "Pipeline for the StrictRedis class" @@ -2939,13 +2935,13 @@ class Script(object): args = tuple(keys) + tuple(args) # make sure the Redis server knows about the script if isinstance(client, BasePipeline): - # make sure this script is good to go on pipeline - client.script_load_for_pipeline(self) + # Make sure the pipeline can register the script before executing. + client.scripts.add(self) try: return client.evalsha(self.sha, len(keys), *args) except NoScriptError: # Maybe the client is pointed to a differnet server than the client # that created this instance? - # Overwrite the sha just in case there was a discrepancy + # 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) |