Removed unused code
This commit is contained in:
parent
6af0cd2be8
commit
9cce441f6c
@ -1,5 +1,3 @@
|
|||||||
import functools
|
|
||||||
import itertools
|
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
import bson
|
import bson
|
||||||
@ -11,19 +9,6 @@ from pillar.api.utils import jsonify
|
|||||||
blueprint = Blueprint('latest', __name__)
|
blueprint = Blueprint('latest', __name__)
|
||||||
|
|
||||||
|
|
||||||
def keep_fetching(collection, db_filter, projection, sort, py_filter,
|
|
||||||
batch_size=12):
|
|
||||||
"""Yields results for which py_filter returns True"""
|
|
||||||
|
|
||||||
db_filter['_deleted'] = {'$ne': True}
|
|
||||||
curs = collection.find(db_filter, projection).sort(sort)
|
|
||||||
curs.batch_size(batch_size)
|
|
||||||
|
|
||||||
for doc in curs:
|
|
||||||
if py_filter(doc):
|
|
||||||
yield doc
|
|
||||||
|
|
||||||
|
|
||||||
def _public_project_ids() -> typing.List[bson.ObjectId]:
|
def _public_project_ids() -> typing.List[bson.ObjectId]:
|
||||||
"""Returns a list of ObjectIDs of public projects.
|
"""Returns a list of ObjectIDs of public projects.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user