Skip to content

Commit

Permalink
Remove memcached deletion from hardcache cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
dellis23 committed Oct 12, 2016
1 parent 8b31ebc commit d5992d6
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions r2/r2/lib/hardcachebackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,7 @@ def delete_if_expired(self, category, ids, expiration="now"):

def delete_expired(expiration="now", limit=5000):
# the following depends on the structure of g.hardcache not changing
backend = g.hardcache.caches[2].backend
memcache = g.hardcache.caches[1]
backend = g.hardcache.caches[1].backend
# localcache = g.hardcache.caches[0]

masters = set()
Expand All @@ -342,14 +341,5 @@ def delete_expired(expiration="now", limit=5000):
if len(rows) == 0:
continue

# Delete them from memcache
mc_keys = [ "%s-%s" % (c, i) for e, c, i in rows ]
memcache.delete_multi(mc_keys)

# Now delete them from the backend.
# Delete from the backend.
engine.delete(expiration_clause).execute()

# Note: In between the previous two steps, a key with a
# near-instantaneous expiration could have been added and expired, and
# thus it'll be deleted from the backend but not memcache. But that's
# okay, because it should be expired from memcache anyway by now.

0 comments on commit d5992d6

Please sign in to comment.