Skip to content

Commit

Permalink
Merge pull request #116 from uktrade/bugfix/celery-worker-tasks-config
Browse files Browse the repository at this point in the history
Adds settings import and django.setup to celery_worker task
  • Loading branch information
gdbarnes authored Dec 11, 2024
2 parents d025f75 + c66d51c commit 13fc222
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ local_settings.py
db.sqlite3
db.sqlite3-journal
fbr/static
static/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
Expand Down
6 changes: 6 additions & 0 deletions celery_worker/tasks.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# flake8: noqa

import os
import time

from celery import shared_task

import django

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fbr.settings")
django.setup()

from app.cache.legislation import Legislation
from app.cache.public_gateway import PublicGateway
from app.search.config import SearchDocumentConfig
Expand Down

0 comments on commit 13fc222

Please sign in to comment.