Skip to content

Commit

Permalink
Created ExpiringMembersSet
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed Dec 18, 2024
1 parent 39188d9 commit c09b495
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/about/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ toc_depth: 2
### 🚀 Features

- Add support disable_decoding in async read_response #349
- Implement support for `SADDEX`, using a new set implementation with support for expiring members #350

## v2.26.2

Expand Down
4 changes: 2 additions & 2 deletions fakeredis/commands_mixins/sortedset_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
null_terminate,
Database,
)
from fakeredis.model import ZSet
from fakeredis.model import ZSet, ExpiringMembersSet

SORTED_SET_METHODS = {
"ZUNIONSTORE": lambda s1, s2: s1 | s2,
Expand Down Expand Up @@ -391,7 +391,7 @@ def zscore(self, key, member):

@staticmethod
def _get_zset(value):
if isinstance(value, set):
if isinstance(value, ExpiringMembersSet):
zset = ZSet()
for item in value:
zset[item] = 1.0
Expand Down

0 comments on commit c09b495

Please sign in to comment.