Skip to content

Commit

Permalink
Log build/sync tasks when triggered
Browse files Browse the repository at this point in the history
Logging these 2 tasks allow us to know immediately which project could be
causing a spike on the celery queues.
  • Loading branch information
humitos committed Apr 26, 2020
1 parent fb01c6d commit f6ee32b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions readthedocs/core/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ def trigger_build(project, version=None, commit=None, record=True, force=False):
:returns: Celery AsyncResult promise and Build instance
:rtype: tuple
"""
log.info(
'Triggering build. project=%s version=%s commit=%s',
project.slug,
version.slug,
commit,
)
update_docs_task, build = prepare_build(
project,
version,
Expand Down
5 changes: 5 additions & 0 deletions readthedocs/core/views/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ def sync_versions(project):
# respect the queue for this project
options['queue'] = project.build_queue

log.info(
'Triggering sync repository. project=%s version=%s',
version.project.slug,
version.slug,
)
sync_repository_task.apply_async(
(version.pk,),
**options,
Expand Down

0 comments on commit f6ee32b

Please sign in to comment.