Last active
August 29, 2015 13:57
-
-
Save tucotuco/9517787 to your computer and use it in GitHub Desktop.
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
if len(ids) < 1: # Didn't find any matches in this batch. | |
if len(docs) == 100: | |
next_id = docs[-1].doc_id | |
else: | |
index.delete(id) | |
return | |
else: # Matches found, delete them. | |
blast, next_id = ids[:-1], ids[-1] | |
index.delete(blast) | |
params = dict(index_name=index_name, namespace=namespace, id=next_id, | |
resource=resource) | |
if len(docs) >= 100: | |
logging.info(params) | |
logging.info('DOCS %s' % len(docs)) | |
logging.info('IDS %s' % len(ids)) | |
if len(blast) == 1 and next_id == blast[0]: | |
index.delete(next_id) | |
return | |
taskqueue.add(url='/index-delete-resource', params=params, | |
queue_name="index-delete-resource") |
eightysteele
commented
Mar 13, 2014
if len(ids) < 1: # Didn't find any matches in this batch.
if len(docs) == 100:
next_id = docs[-1].doc_id
else:
index.delete(id)
return
else: # Matches found, delete them.
blast, next_id = ids[:-1], ids[-1]
index.delete(blast)
params = dict(index_name=index_name, namespace=namespace, id=next_id,
resource=resource)
if len(docs) >= 100:
logging.info(params)
logging.info('DOCS %s' % len(docs))
logging.info('IDS %s' % len(ids))
if len(blast) == 1 and next_id == blast[0]:
index.delete(next_id)
return
taskqueue.add(url='/index-delete-resource', params=params,
queue_name="index-delete-resource")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment