Skip to content

Commit

Permalink
White or black list processes in dispatcher
Browse files Browse the repository at this point in the history
This is q&d solution just for testing.
  • Loading branch information
gregorjerse committed Nov 14, 2023
1 parent bfa374a commit 673fabf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions resolwe/flow/managers/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,17 @@ def process_data_object(data: Data):

try:
queryset = Data.objects.filter(status=Data.STATUS_RESOLVING)

whitelist = json.loads(os.environ.get("RESOLWE_PROCESS_WHITELIST", "null"))
blacklist = json.loads(os.environ.get("RESOLWE_PROCESS_BLACKLIST", "null"))

if whitelist:
assert isinstance(whitelist, list)
queryset = queryset.filter(process__slug__in=whitelist)
if blacklist:
assert isinstance(blacklist, list)
queryset = queryset.exclude(process__slug__in=blacklist)

if data_id is not None:
# Scan only given data object and its children.
queryset = queryset.filter(
Expand Down

0 comments on commit 673fabf

Please sign in to comment.