Commit bc181c30 authored by Nitesh Selkari's avatar Nitesh Selkari
Browse files

batch processing for legaltags

parent 713c1d20
Pipeline #61497 failed with stage
in 11 seconds
......@@ -80,7 +80,7 @@ def evaluate_policy():
input_json = posted_data['input']
access_token=str(request.headers['Authorization'])
data_partition_id=request.headers['data-partition-id']
access_token=access_token.split(' ')[-1]
access_token=access_token.split(' ')[-1]
try:
# get userinfo
user_info=get_user_info(access_token)
......@@ -95,7 +95,10 @@ def evaluate_policy():
legaltagslist.extend(get_legal_tag_list(record))
if not 'legaltags' in input_json or not isinstance(input_json['legaltags'], list):
input_json['legaltags'] = []
input_json['legaltags'].extend(get_legal_tag_info(legaltagslist, data_partition_id, access_token))
# Added for issue#17
legalTagListLen = len(legaltagslist)
for x in range(0, legalTagListLen+1, 25):
input_json['legaltags'].extend(get_legal_tag_info(legaltagslist[x:x+25], data_partition_id, access_token))
except Exception as err:
logging.info(err)
url = conf.OPA_DATA_API + '/' + policy_id
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment