Skip to content

Commit 8f9a419

Browse files
authored
Fix missing sync repo task (#3265)
* Fix missing sync repo task This was not caught on celery 4 upgrade * Missing apps file, oops
1 parent 4de678e commit 8f9a419

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

readthedocs/oauth/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
default_app_config = 'readthedocs.oauth.apps.OAuthConfig'

readthedocs/oauth/apps.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""OAuth app config"""
2+
3+
from django.apps import AppConfig
4+
5+
6+
class OAuthConfig(AppConfig):
7+
name = 'readthedocs.oauth'
8+
9+
def ready(self):
10+
from .tasks import SyncRemoteRepositories
11+
from readthedocs.worker import app
12+
app.tasks.register(SyncRemoteRepositories)

readthedocs/oauth/tasks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
@permission_check(user_id_matches)
1313
class SyncRemoteRepositories(PublicTask):
14+
15+
name = __name__ + '.sync_remote_repositories'
1416
public_name = 'sync_remote_repositories'
1517
queue = 'web'
1618

readthedocs/restapi/views/task_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def job_status(request, task_id):
5353
@decorators.permission_classes((permissions.IsAuthenticated,))
5454
@decorators.renderer_classes((JSONRenderer,))
5555
def sync_remote_repositories(request):
56-
result = tasks.sync_remote_repositories.delay(
56+
result = tasks.SyncRemoteRepositories().delay(
5757
user_id=request.user.id)
5858
task_id = result.task_id
5959
return Response({

0 commit comments

Comments
 (0)