'Update the state of the given KeyRangeItem.
Args:
item: A KeyRange instance.'

def UpdateProgress(self, item):

    if (item.state == STATE_GOT):
        count = self.result_db.StoreEntities(item.download_result.keys, item.download_result.entities)
        self.db.DeleteKey(item.progress_key)
        self.entities_transferred += count
    else:
        self.db.UpdateState(item.progress_key, item.state)
