Skip to content

Commit

Permalink
Apply fixes suggested in jazzband#654
Browse files Browse the repository at this point in the history
Signed-off-by: Aalekh Patel <[email protected]>
  • Loading branch information
CdnCentreForChildProtection committed Nov 29, 2023
1 parent f25135c commit 9e12c2e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
12 changes: 12 additions & 0 deletions django_redis/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ def sdiffstore(self, *args, **kwargs):
def sinter(self, *args, **kwargs):
return self.client.sinter(*args, **kwargs)

@omit_exception
def sintercard(self, *args, **kwargs):
return self.client.sintercard(*args, **kwargs)

@omit_exception
def sinterstore(self, *args, **kwargs):
return self.client.sinterstore(*args, **kwargs)
Expand All @@ -212,6 +216,10 @@ def sinterstore(self, *args, **kwargs):
def sismember(self, *args, **kwargs):
return self.client.sismember(*args, **kwargs)

@omit_exception
def smismember(self, *args, **kwargs):
return self.client.smismember(*args, **kwargs)

@omit_exception
def smembers(self, *args, **kwargs):
return self.client.smembers(*args, **kwargs)
Expand All @@ -228,6 +236,10 @@ def spop(self, *args, **kwargs):
def srandmember(self, *args, **kwargs):
return self.client.srandmember(*args, **kwargs)

@omit_exception
def sscan(self, *args, **kwargs):
return self.client.sscan(*args, **kwargs)

@omit_exception
def srem(self, *args, **kwargs):
return self.client.srem(*args, **kwargs)
Expand Down
12 changes: 8 additions & 4 deletions django_redis/client/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,16 +818,20 @@ def sdiff(
def sdiffstore(
self,
dest: Any,
key: Any,
*keys,
version: Optional[int] = None,
versionDest: Optional[int] = None,
versionMinuend: Optional[int] = None,
versionSubtrahend: Optional[int] = None,
client: Optional[Redis] = None,
) -> int:
if client is None:
client = self.get_client(write=True)

dest = self.make_key(dest, version=version)
keys = [self.make_key(key, version=version) for key in keys]
return int(client.sdiffstore(dest, *keys))
dest = self.make_key(dest, version=versionDest)
minuend_key = self.make_key(key, version=versionMinuend)
subtrahend_keys = [self.make_key(key_, version=versionSubtrahend) for key_ in keys]
return int(client.sdiffstore(dest, minuend_key, *subtrahend_keys))


def sinter(
Expand Down

0 comments on commit 9e12c2e

Please sign in to comment.