Skip to content
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

remove time value for delete #62

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions memcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,12 +430,9 @@ def delete_multi(self, keys, time=0, key_prefix='', noreply=False):
bigcmd = []
write = bigcmd.append
extra = ' noreply' if noreply else ''
if time is not None:
for key in server_keys[server]: # These are mangled keys
write("delete %s %d%s\r\n" % (key, time, extra))
else:
for key in server_keys[server]: # These are mangled keys
write("delete %s%s\r\n" % (key, extra))
for key in server_keys[server]: # These are mangled keys
write("delete %s%s\r\n" % (key, extra))

try:
server.send_cmds(''.join(bigcmd))
except socket.error as msg:
Expand Down Expand Up @@ -500,10 +497,7 @@ def _deletetouch(self, expected, cmd, key, time=0, noreply=False):
return 0
self._statlog(cmd)
extra = ' noreply' if noreply else ''
if time is not None and time != 0:
cmd = "%s %s %d%s" % (cmd, key, time, extra)
else:
cmd = "%s %s%s" % (cmd, key, extra)
cmd = "%s %s%s" % (cmd, key, extra)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is also used for touch, which is valid with a time value. delete could maybe just pass zero to this method instead?


try:
server.send_cmd(cmd)
Expand Down