-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve the rebuild search index task * Include dbbackups in make web command
- Loading branch information
Showing
3 changed files
with
9 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
from celery import shared_task | ||
from haystack.management.commands import update_index | ||
from celery.utils.log import get_task_logger | ||
|
||
logger = get_task_logger(__name__) | ||
|
||
|
||
@shared_task | ||
def rebuild_index(): | ||
import subprocess | ||
subprocess.call(['python', 'manage.py', 'rebuild_index']) | ||
def rebuild_search_index(): | ||
""" | ||
Celery task to rebuild the search index. | ||
""" | ||
update_index.Command().handle() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters