Skip to content

Commit a3fee86

Browse files
committed
Fixing cache.
1 parent 9afc406 commit a3fee86

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

omnipkg/cache.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,5 +241,15 @@ def srem(self, key, value):
241241
def hdel(self, key, *fields):
242242
self.commands.append((self.client.hdel, [key] + list(fields), {}))
243243
return self
244+
245+
def sadd(self, name: str, *values):
246+
# Pass `name` and the tuple of `values` to the client's sadd method
247+
self.commands.append((self.client.sadd, [name] + list(values), {}))
248+
return self
249+
250+
def set(self, key, value, ex=None):
251+
# The 'ex' argument for TTL is needed for redis-py compatibility
252+
self.commands.append((self.client.set, [key, value], {'ex': ex}))
253+
return self
244254

245255
# Add other methods here as needed to expand pipeline functionality.

0 commit comments

Comments
 (0)