Skip to content

Commit

Permalink
undo celery but keep docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
i-oden committed Jan 9, 2025
1 parent 7ffaa7f commit b39b6ee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
8 changes: 0 additions & 8 deletions dds_web/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import sqlalchemy
import structlog
import werkzeug
from celery import Celery

####################################################################################################
# GLOBAL VARIABLES ############################################################## GLOBAL VARIABLES #
Expand Down Expand Up @@ -63,9 +62,6 @@
# Migration
migrate = flask_migrate.Migrate()

# Celery
celery = Celery()

####################################################################################################
# FUNCTIONS ############################################################################ FUNCTIONS #
####################################################################################################
Expand Down Expand Up @@ -283,10 +279,6 @@ def load_user(user_id):
# Initialize migrations
migrate.init_app(app, db)

# Celery
celery = Celery(app.name, broker=app.config["CELERY_BROKER_URL"])
celery.conf.update(app.config)

# initialize OIDC
oauth.init_app(app)
oauth.register(
Expand Down
4 changes: 1 addition & 3 deletions dds_web/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,4 @@ class Config(object):
# Logging setup; 0 means no log rotation
LOG_MAX_SIZE = os.environ.get("LOG_MAX_SIZE", 0x100000)
LOG_BACKUP_COUNT = os.environ.get("LOG_BACKUP_COUNT", 15)

CELERY_BROKER_URL = 'redis://localhost:6379/0'
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'

11 changes: 7 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,13 @@ services:
source: ../dds_cli
target: /code

worker:
celery:
build:
context: .
dockerfile: Dockerfiles/backend.Dockerfile
context: .
environment:
FLASK_APP: run
volumes:
- .:/app
command: celery -A run.celery worker --loglevel=info
links:
depends_on:
- redis

0 comments on commit b39b6ee

Please sign in to comment.