Skip to content

Commit

Permalink
Merge pull request #80 from edly-io/tai/update_dataloader_api
Browse files Browse the repository at this point in the history
Update Dataloader api
  • Loading branch information
taimoor-ahmed-1 committed May 2, 2024
2 parents 9c8a150 + af9f9d2 commit b4d068e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions course_discovery/apps/edly_discovery_app/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

0 comments on commit b4d068e

Please sign in to comment.