Skip to content

Commit

Permalink
fix: add url not found catching
Browse files Browse the repository at this point in the history
  • Loading branch information
ABrain7710 committed Aug 27, 2024
1 parent 7f41d24 commit 2b5ce1a
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions augur/tasks/github/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from augur.tasks.init.celery_app import celery_app as celery
from augur.tasks.init.celery_app import AugurCoreRepoCollectionTask
from augur.application.db.data_parse import *
from augur.tasks.github.util.github_data_access import GithubDataAccess
from augur.tasks.github.util.github_data_access import GithubDataAccess, UrlNotFoundException
from augur.tasks.github.util.github_random_key_auth import GithubRandomKeyAuth
from augur.tasks.github.util.util import get_owner_repo
from augur.tasks.util.worker_util import remove_duplicate_dicts
Expand Down Expand Up @@ -280,17 +280,20 @@ def _collect_and_process_issue_events(self, owner, repo, repo_id, key_auth):

event_url = f"https://api.github.com/repos/{owner}/{repo}/issues/{issue_number}/events"

for event in github_data_access.paginate_resource(event_url):
try:
for event in github_data_access.paginate_resource(event_url):

event, contributor = self._process_github_event_contributors(event)
event, contributor = self._process_github_event_contributors(event)

if contributor:
contributors.append(contributor)
if contributor:
contributors.append(contributor)

events.append(
extract_issue_event_data(event, issue["issue_id"], platform_id, repo_id,
self._tool_source, self._tool_version, self._data_source)
)
events.append(
extract_issue_event_data(event, issue["issue_id"], platform_id, repo_id,
self._tool_source, self._tool_version, self._data_source)
)
except UrlNotFoundException as e:
self._logger.warning(f"{self.repo_identifier}: Url not found for {event_url}")

if len(events) > 500:
self._insert_contributors(contributors)
Expand Down

0 comments on commit 2b5ce1a

Please sign in to comment.