Skip to content

Commit 3c7b914

Browse files
committed
Update J1QLdeferredResponse.py
1 parent 6e26d73 commit 3c7b914

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/J1QLdeferredResponse.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"""
3939

4040
gql_variables = {
41-
"query": "find (snyk_finding | snyk_finding_coordinate | insightvm_finding | github_finding | semgrep_finding)",
41+
"query": "FIND Finding",
4242
"deferredResponse": "FORCE",
4343
"cursor": "",
4444
"flags": {
@@ -50,6 +50,7 @@
5050
"query": gql_query,
5151
"variables": gql_variables
5252
}
53+
5354
all_query_results = []
5455
cursor = None
5556

@@ -58,7 +59,7 @@
5859
payload['variables']['cursor'] = cursor
5960

6061
s = requests.Session()
61-
retries = Retry(total=10, backoff_factor=2, status_forcelist=[502, 503, 504, 429])
62+
retries = Retry(total=5, backoff_factor=1, status_forcelist=[502, 503, 504, 429])
6263
s.mount('https://', HTTPAdapter(max_retries=retries))
6364
url_response = s.post(j1_graphql_url, headers=j1_graphql_headers, json=payload)
6465
download_url = url_response.json()['data']['queryV1']['url']
@@ -69,7 +70,7 @@
6970
status = download_response['status']
7071

7172
while status == 'IN_PROGRESS':
72-
time.sleep(1) # Sleep 1 second between checking status
73+
time.sleep(0.2) # Sleep 200 milliseconds between checking status
7374

7475
download_response = s.get(download_url).json() # fetch results data from download URL
7576

0 commit comments

Comments
 (0)