I have a python function(python 3.6) which executes approximately 140-150 jira search_issue queries and each query approximately takes 7-8 seconds to return the result. So in all this python function takes like 4-5 mins to execute.
Is there a way how to run these queries in parallel inside the python function so that python function's execution time reduces?
I am using 'Jira' package in python.
from jira import JIRA
def jira():
user = #####
pwd = #####
jira_access = JIRA("https://#####.atlassian.net", basic_auth=(user, pwd))
return jira_access
def jira_count(jira_filter):
result = jira().search_issues(jira_filter, startAt=0, maxResults=0)
total_count = len(result)
return total_count
def final_view():
query1 = jira_count(jira_filter1)
query2 = jira_count(jira_filter2)
query3 = jira_count(jira_filter3)
.
.
.
.
.
query150 = jira_count(jira_filter150)
return query1, query2, query3 ..... query150