Skip to content

Commit

Permalink
update reindex post deploy tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
samonaisi committed Nov 26, 2024
1 parent f890395 commit 354cc8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions apps/deploys/task_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from apps.commons.models import PermissionsSetupModel

from .tasks import (
algolia_reindex_task,
rebuild_index,
base_groups_permissions,
instance_groups_permissions,
migrate,
Expand Down Expand Up @@ -45,10 +45,10 @@ class BaseGroupsPermissions(PostDeployTask):
run_in_tests = True


class AlgoliaReindex(PostDeployTask):
task_name = "algolia_reindex"
class RebuildIndex(PostDeployTask):
task_name = "rebuild_index"
priority = 3
task = algolia_reindex_task
task = rebuild_index


class InstanceGroupsPermissions(PostDeployTask):
Expand Down
8 changes: 6 additions & 2 deletions apps/deploys/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ def migrate():


@app.task
def algolia_reindex_task():
call_command("algolia_reindex")
def rebuild_index():
"""
python manage.py opensearch index rebuild --force
"""
call_command("opensearch", "index", "rebuild", "--force")
call_command("opensearch", "document", "index", "--force")


@app.task
Expand Down

0 comments on commit 354cc8a

Please sign in to comment.