Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Commit d095a5b

Browse files
authored
Some improvements (#441)
* Improve the rebuild search index task * Include dbbackups in make web command
1 parent 5a58da0 commit d095a5b

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

dockerize/Makefile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,7 @@ web: db
3535
@echo "------------------------------------------------------------------"
3636
@echo "Running in production mode"
3737
@echo "------------------------------------------------------------------"
38-
@docker compose -p $(PROJECT_ID) up -d --scale uwsgi=2 web worker beat
39-
40-
dbbackups: db
41-
@echo
42-
@echo "------------------------------------------------------------------"
43-
@echo "Running dbbackups in production mode"
44-
@echo "------------------------------------------------------------------"
45-
@docker compose -p $(PROJECT_ID) up -d dbbackups
38+
@docker compose -p $(PROJECT_ID) up -d --scale uwsgi=2 web worker beat dbbackups
4639

4740
certbot: web
4841
@echo
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
from celery import shared_task
2+
from haystack.management.commands import update_index
23
from celery.utils.log import get_task_logger
34

45
logger = get_task_logger(__name__)
56

6-
77
@shared_task
8-
def rebuild_index():
9-
import subprocess
10-
subprocess.call(['python', 'manage.py', 'rebuild_index'])
8+
def rebuild_search_index():
9+
"""
10+
Celery task to rebuild the search index.
11+
"""
12+
update_index.Command().handle()

qgis-app/settings_docker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@
160160
# Index synchronization sometimes fails when deleting
161161
# a plugin and None is listed in the search list. So I think
162162
# it would be better if we rebuild the index frequently
163-
'rebuild_index': {
164-
'task': 'plugins.tasks.rebuild_index.rebuild_index',
163+
'rebuild_search_index': {
164+
'task': 'plugins.tasks.rebuild_search_index.rebuild_search_index',
165165
'schedule': crontab(minute=0, hour=3), # Execute every day at 3 AM.
166166
}
167167
}

0 commit comments

Comments
 (0)