Skip to content

Commit 0c89b3c

Browse files
committed
Added comments cross-referencing identical logic in entity-api and ingest-api
1 parent 1843f21 commit 0c89b3c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/schema/schema_constants.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ class Neo4jRelationshipEnum(Enum):
6565
USES_DATA = 'USES_DATA'
6666

6767
# Define an enumeration of re-index priority level types.
68-
# N.B. same levels defined for the enqueue() method at
69-
# https://github.com/x-atlas-consortia/jobq/blob/main/src/atlas_consortia_jobq/queue.py
68+
# N.B. This is the same values maintained in ingest-api app.py _get_reindex_priority(), which
69+
# must be the same levels defined for the enqueue() method at
70+
# https://github.com/x-atlas-consortia/jobq/blob/main/src/atlas_consortia_jobq/queue.py
7071
class ReindexPriorityLevelEnum(Enum):
7172
HIGH = 1
7273
MEDIUM = 2

src/schema/schema_manager.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2406,6 +2406,9 @@ def get_organ_types():
24062406
bool
24072407
"""
24082408
def suppress_reindex(request_args) -> bool:
2409+
# N.B. This logic should be the same as that used by
2410+
# ingest-api app.py _suppress_reindex()
2411+
# https://github.com/hubmapconsortium/ingest-api/blob/main/src/app.py
24092412
if 'reindex' not in request_args:
24102413
return False
24112414
reindex_str = request_args.get('reindex').lower()
@@ -2432,6 +2435,9 @@ def suppress_reindex(request_args) -> bool:
24322435
int value from the enumeration ReindexPriorityLevelEnum
24332436
"""
24342437
def get_reindex_priority(request_args:ImmutableMultiDict, calc_suppress_reindex:bool) -> int:
2438+
# N.B. This logic should be the same as that used by
2439+
# ingest-api app.py _get_reindex_priority()
2440+
# https://github.com/hubmapconsortium/ingest-api/blob/main/src/app.py
24352441
if calc_suppress_reindex and 'reindex-priority' in request_args:
24362442
raise Exception("Specifying a re-index priority is incompatible with suppressing re-indexing.")
24372443
if 'reindex-priority' not in request_args:

0 commit comments

Comments
 (0)