|
7 | 7 | from augur.tasks.init.celery_app import celery_app as celery
|
8 | 8 | from augur.tasks.init.celery_app import AugurCoreRepoCollectionTask
|
9 | 9 | from augur.application.db.data_parse import *
|
10 |
| -from augur.tasks.github.util.github_data_access import GithubDataAccess |
| 10 | +from augur.tasks.github.util.github_data_access import GithubDataAccess, UrlNotFoundException |
11 | 11 | from augur.tasks.github.util.github_random_key_auth import GithubRandomKeyAuth
|
12 | 12 | from augur.tasks.github.util.util import get_owner_repo
|
13 | 13 | from augur.tasks.util.worker_util import remove_duplicate_dicts
|
@@ -280,17 +280,20 @@ def _collect_and_process_issue_events(self, owner, repo, repo_id, key_auth):
|
280 | 280 |
|
281 | 281 | event_url = f"https://api.github.com/repos/{owner}/{repo}/issues/{issue_number}/events"
|
282 | 282 |
|
283 |
| - for event in github_data_access.paginate_resource(event_url): |
| 283 | + try: |
| 284 | + for event in github_data_access.paginate_resource(event_url): |
284 | 285 |
|
285 |
| - event, contributor = self._process_github_event_contributors(event) |
| 286 | + event, contributor = self._process_github_event_contributors(event) |
286 | 287 |
|
287 |
| - if contributor: |
288 |
| - contributors.append(contributor) |
| 288 | + if contributor: |
| 289 | + contributors.append(contributor) |
289 | 290 |
|
290 |
| - events.append( |
291 |
| - extract_issue_event_data(event, issue["issue_id"], platform_id, repo_id, |
292 |
| - self._tool_source, self._tool_version, self._data_source) |
293 |
| - ) |
| 291 | + events.append( |
| 292 | + extract_issue_event_data(event, issue["issue_id"], platform_id, repo_id, |
| 293 | + self._tool_source, self._tool_version, self._data_source) |
| 294 | + ) |
| 295 | + except UrlNotFoundException as e: |
| 296 | + self._logger.warning(f"{self.repo_identifier}: Url not found for {event_url}") |
294 | 297 |
|
295 | 298 | if len(events) > 500:
|
296 | 299 | self._insert_contributors(contributors)
|
|
0 commit comments