Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some improvements #441

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions dockerize/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,7 @@ web: db
@echo "------------------------------------------------------------------"
@echo "Running in production mode"
@echo "------------------------------------------------------------------"
@docker compose -p $(PROJECT_ID) up -d --scale uwsgi=2 web worker beat

dbbackups: db
@echo
@echo "------------------------------------------------------------------"
@echo "Running dbbackups in production mode"
@echo "------------------------------------------------------------------"
@docker compose -p $(PROJECT_ID) up -d dbbackups
@docker compose -p $(PROJECT_ID) up -d --scale uwsgi=2 web worker beat dbbackups

certbot: web
@echo
Expand Down
10 changes: 6 additions & 4 deletions qgis-app/plugins/tasks/rebuild_search_index.py
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()
4 changes: 2 additions & 2 deletions qgis-app/settings_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@
# Index synchronization sometimes fails when deleting
# a plugin and None is listed in the search list. So I think
# it would be better if we rebuild the index frequently
'rebuild_index': {
'task': 'plugins.tasks.rebuild_index.rebuild_index',
'rebuild_search_index': {
'task': 'plugins.tasks.rebuild_search_index.rebuild_search_index',
'schedule': crontab(minute=0, hour=3), # Execute every day at 3 AM.
}
}
Expand Down