Skip to content

Commit

Permalink
feat: Updated scripts/jobs/create_issues_from_stra
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] authored Mar 23, 2024
1 parent c42f827 commit 1e6aa05
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions scripts/jobs/create_issues_from_strategy_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ def create_github_issue(title, body, token, repo):
"title": title,
"body": body
}
response = requests.post(url, headers=headers, data=json.dumps(data))
response = post_github_issue(url, headers, data)
if response.status_code == 201:
print(f"Issue '{title}' created successfully.")
elif response.status_code == 429:
print("Rate limit exceeded. Waiting 60 seconds before retrying...")
time.sleep(60)
create_github_issue(title, body, token, repo)
handle_rate_limit(response, title, body, token, repo)
elif response.status_code == 401:
raise Exception("Authentication failed. Check your GitHub token.")
else:
Expand Down

0 comments on commit 1e6aa05

Please sign in to comment.