From f1435383314b34b5d856ebd974ebc0cb3b585244 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Wed, 20 Oct 2021 13:53:15 +0200 Subject: [PATCH] Use a Celery task to re-sync RemoteRepository --- readthedocs/api/v2/views/integrations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readthedocs/api/v2/views/integrations.py b/readthedocs/api/v2/views/integrations.py index 9a6b0113585..e428d20b06f 100644 --- a/readthedocs/api/v2/views/integrations.py +++ b/readthedocs/api/v2/views/integrations.py @@ -30,7 +30,8 @@ trigger_sync_versions, ) from readthedocs.integrations.models import HttpExchange, Integration -from readthedocs.projects.models import Feature, Project +from readthedocs.oauth.tasks import sync_remote_repositories +from readthedocs.projects.models import Project, Feature log = logging.getLogger(__name__) @@ -463,8 +464,7 @@ def handle_webhook(self): provider=GitHubProvider.id, uid=uid, ) - service = GitHubService(user=socialaccount.user, account=socialaccount) - service.sync() + sync_remote_repositories.delay(socialaccount.user.pk) return None