From d92e4f3c7499616caa7f2a768c2c6afa9840b9c6 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Mon, 11 Feb 2019 09:06:34 -0300 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20delay=20search=20delete=20on=20?= =?UTF-8?q?project=20delete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was causing an issue where we were trying to delete a project that didn’t exist, so it wasn’t getting removed from the index properly. It should be done in process, otherwise it’s a race condition. --- readthedocs/search/signals.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readthedocs/search/signals.py b/readthedocs/search/signals.py index 9a128fcb848..86160af095e 100644 --- a/readthedocs/search/signals.py +++ b/readthedocs/search/signals.py @@ -73,6 +73,6 @@ def remove_project_delete(instance, *args, **kwargs): 'objects_id': [instance.id], } - # Do not index if autosync is disabled globally + # Don't `delay` this because the objects will be deleted already if DEDConfig.autosync_enabled(): - delete_objects_in_es.delay(**kwargs) + delete_objects_in_es(**kwargs)