-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix django2.0 #179
Merged
jogo
merged 14 commits into
pinterest:master
from
uncovertruth:feature/set_many_result2
Aug 15, 2018
Merged
fix django2.0 #179
Changes from 4 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9825b41
fix return object
opapy b18ce05
fix test
opapy 210d738
fix pep8
opapy 1d99958
fix ChangeLog.rst
opapy 8d1bc90
add validation code with NOT_STORED
opapy 08667da
fix pep8
opapy 8bf60ad
fix result
opapy d6a8bdb
fix implementation HashClient
opapy bd2a241
fix test
opapy de69dd2
fix pep8
opapy ebca739
fix failed keys
opapy 2fe1c5a
refactor
opapy 0ac3dc7
fix comment for set_many
opapy 8ce0737
fix comment for set_many
opapy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -241,13 +241,13 @@ def decr(self, key, *args, **kwargs): | |
|
||
def set_many(self, values, *args, **kwargs): | ||
client_batches = {} | ||
end = [] | ||
failed = [] | ||
|
||
for key, value in values.items(): | ||
client = self._get_client(key) | ||
|
||
if client is None: | ||
end.append(False) | ||
failed.append(key) | ||
continue | ||
|
||
if client.server not in client_batches: | ||
|
@@ -261,11 +261,11 @@ def set_many(self, values, *args, **kwargs): | |
new_args.insert(0, values) | ||
result = self._safely_run_func( | ||
client, | ||
client.set_many, False, *new_args, **kwargs | ||
client.set_many, values.keys(), *new_args, **kwargs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so this means, if any of these keys fail, we mark all as failed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks! |
||
) | ||
end.append(result) | ||
failed.extend(result) | ||
|
||
return all(end) | ||
return failed | ||
|
||
set_multi = set_many | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't this now return a list of failed sets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx! i fixed it.