Skip to content

Commit 53d26b1

Browse files
authored
Run spam check after a sucessful build (#11980)
Trigger the task to check for spam after the build succeed. It won't run for all the projects, only for those that we suspect could be spam ;) Requires: readthedocs/readthedocs-ext#569
1 parent 9b1e784 commit 53d26b1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

readthedocs/projects/tasks/builds.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,14 @@ def on_success(self, retval, task_id, args, kwargs):
676676
# Index search data
677677
index_build.delay(build_id=self.data.build["id"])
678678

679+
# Check if the project is spam
680+
if "readthedocsext.spamfighting" in settings.INSTALLED_APPS:
681+
from readthedocsext.spamfighting.tasks import ( # noqa
682+
spam_check_after_build_complete,
683+
)
684+
685+
spam_check_after_build_complete.delay(build_id=self.data.build["id"])
686+
679687
if not self.data.project.has_valid_clone:
680688
self.set_valid_clone()
681689

0 commit comments

Comments
 (0)