Skip to content

Commit

Permalink
Add hint scheme for tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
munrojm committed Dec 11, 2021
1 parent d6e5cde commit 4862fab
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/mp_api/routes/tasks/hint_scheme.py
@@ -0,0 +1,16 @@
from maggma.api.resource import HintScheme


class TasksHintScheme(HintScheme):
"""
Hint scheme for the tasks endpoint.
"""

def generate_hints(self, query):

hints = {"hint": {}}

if query["criteria"] == {}:
hints["hint"]["_id"] = 1

return hints

0 comments on commit 4862fab

Please sign in to comment.