Skip to content

Commit 851bdb8

Browse files
committed
refactor: have a break
1 parent 56c07f2 commit 851bdb8

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

scripts/download_sa_advisories.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ def download_sa_advisories_from_rest_api(last_modified_timestamp: int) -> None:
4949

5050
print(f'fetching sa advisories modified after {last_modified_timestamp}')
5151
url = 'https://www.drupal.org/api-d7/node.json?type=sa&sort=changed&direction=DESC&field_is_psa=0'
52-
fetch_again = True
53-
while fetch_again:
52+
while True:
5453
print(f'fetching {url}')
5554
response = requests.get(url, headers={'user-agent': user_agent})
5655
if response.status_code == 200:
@@ -67,16 +66,16 @@ def download_sa_advisories_from_rest_api(last_modified_timestamp: int) -> None:
6766
f.write('\n')
6867
else:
6968
# We have reached the last modified entry.
70-
fetch_again = False
69+
break
7170
print(' \\- finished processing page')
7271
if 'next' in data and data['next'] != '':
7372
url = data['next'].replace('api-d7/node?', 'api-d7/node.json?')
7473
else:
7574
print('finished processing new and updated advisories')
76-
fetch_again = False
75+
break
7776
else:
7877
print(f'X API responded {response.status_code}')
79-
fetch_again = False
78+
break
8079

8180

8281
most_recent_changed_time = get_most_recent_changed_timestamp()

0 commit comments

Comments
 (0)