From af9f9d2822085e499a9123bbfb1da2b07883a814 Mon Sep 17 00:00:00 2001 From: Taimoor Ahmed Date: Thu, 2 May 2024 15:52:44 +0500 Subject: [PATCH] Update Dataloader api --- .../apps/edly_discovery_app/tasks.py | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/course_discovery/apps/edly_discovery_app/tasks.py b/course_discovery/apps/edly_discovery_app/tasks.py index da724687dd..1949e1552c 100644 --- a/course_discovery/apps/edly_discovery_app/tasks.py +++ b/course_discovery/apps/edly_discovery_app/tasks.py @@ -34,13 +34,14 @@ def run_dataloader(partner, course_id, service): course_id=course_id ).ingest() - if service == 'wordpress': - update_index_cmd = "/edx/app/discovery/venvs/discovery/bin/python /edx/app/discovery/discovery/manage.py update_index --disable-change-limit" - remove_unused_index_cmd = "/edx/app/discovery/venvs/discovery/bin/python /edx/app/discovery/discovery/manage.py remove_unused_indexes" - LOGGER.info('Runing update_index command ...') - with subprocess.Popen(update_index_cmd, stdout=subprocess.PIPE, shell=True) as proc: - LOGGER.info(proc.stdout.read()) - - LOGGER.info('Runing remove_unused indexes command ...') - with subprocess.Popen(remove_unused_index_cmd, stdout=subprocess.PIPE, shell=True) as proc: - LOGGER.info(proc.stdout.read()) + ## Removing this piece of code for monitoring index corruption issue. + # if service == 'wordpress': + # update_index_cmd = "/edx/app/discovery/venvs/discovery/bin/python /edx/app/discovery/discovery/manage.py update_index --disable-change-limit" + # remove_unused_index_cmd = "/edx/app/discovery/venvs/discovery/bin/python /edx/app/discovery/discovery/manage.py remove_unused_indexes" + # LOGGER.info('Runing update_index command ...') + # with subprocess.Popen(update_index_cmd, stdout=subprocess.PIPE, shell=True) as proc: + # LOGGER.info(proc.stdout.read()) + + # LOGGER.info('Runing remove_unused indexes command ...') + # with subprocess.Popen(remove_unused_index_cmd, stdout=subprocess.PIPE, shell=True) as proc: + # LOGGER.info(proc.stdout.read())