Skip to content

Commit

Permalink
fix url, can retry errors in deletion orders
Browse files Browse the repository at this point in the history
  • Loading branch information
jefer94 committed Dec 16, 2024
1 parent 43b6bf6 commit bf7e3f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ def delete_github_repositories(self):
while True:
qs = RepositoryDeletionOrder.objects.filter(
Q(
status=RepositoryDeletionOrder.Status.TRANSFERRING,
status__in=[RepositoryDeletionOrder.Status.TRANSFERRING, RepositoryDeletionOrder.Status.ERROR],
starts_transferring_at__lte=timezone.now() - relativedelta(months=2),
)
| Q(
status=RepositoryDeletionOrder.Status.PENDING,
status__in=[RepositoryDeletionOrder.Status.PENDING, RepositoryDeletionOrder.Status.ERROR],
created_at__lte=timezone.now() - relativedelta(months=2),
),
repository_user__in=self.allowed_users,
Expand Down Expand Up @@ -332,7 +332,7 @@ def transfer_ownership(self):
qs = RepositoryDeletionOrder.objects.filter(
repository_user__in=self.allowed_users,
provider=RepositoryDeletionOrder.Provider.GITHUB,
status=RepositoryDeletionOrder.Status.PENDING,
status__in=[RepositoryDeletionOrder.Status.PENDING, RepositoryDeletionOrder.Status.ERROR],
created_at__gt=timezone.now(),
).exclude(id__in=ids)[:100]

Expand Down
2 changes: 1 addition & 1 deletion breathecode/services/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def get_repo_events(
page = 0
while True:
page += 1
res = self.get(f"/orgs/{owner}/{repo}/events?page={page}&per_page={per_page}")
res = self.get(f"/repos/{owner}/{repo}/events?page={page}&per_page={per_page}")

if len(res) == 0:
break
Expand Down

0 comments on commit bf7e3f9

Please sign in to comment.