Skip to content

Commit 3d83afa

Browse files
committed
Route task to proper queue
In #4033, I introduce a bug when using Celery signatures. From Celery's docs at http://docs.celeryproject.org/en/latest/reference/celery.html#celery.signature > the .s() shortcut does not allow you to specify execution options but there’s a chaning .set method that returns the signature So, instead of dealing with multiple `.set()`, I'm just using the `.signature()` method of the task which is more explicit.
1 parent 70181a3 commit 3d83afa

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

readthedocs/core/utils/__init__.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,12 @@ def prepare_build(
139139
options['time_limit'] = int(time_limit * 1.2)
140140

141141
update_docs_task = UpdateDocsTask()
142-
143-
# Py 2.7 doesn't support ``**`` expand syntax twice. We create just one big
144-
# kwargs (including the options) for this and expand it just once.
145-
# return update_docs_task.si(project.pk, **kwargs, **options)
146-
kwargs.update(options)
147-
148-
return update_docs_task.si(project.pk, **kwargs)
142+
return update_docs_task.signature(
143+
(project.pk,),
144+
immutable=True,
145+
kwargs=kwargs,
146+
options=options,
147+
)
149148

150149

151150
def trigger_build(project, version=None, record=True, force=False):

0 commit comments

Comments
 (0)