diff --git a/Dockerfile b/Dockerfile index 4052c456e6af4c35ff6527db22beb395e3701894..ce06ec8596df84636893aee317d67aeae7986b2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,6 @@ WORKDIR /app/ COPY ./poetry.lock /app/ COPY ./pyproject.toml /app/ COPY ./funkwhale_network/ /app/funkwhale_network/ -RUN pip install . +RUN pip install -e . EXPOSE 8000 diff --git a/docker-compose.yml b/docker-compose.yml index 5222ea99cd56af3d261a30678fc3a813b2aef146..cf866f1ce3892040f6b5271f18088492cb3dc303 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -54,7 +54,7 @@ services: worker: restart: ${RESTART_POLICY-unless-stopped} - command: tail -f /dev/null #funkwhale-network worker start + command: arq funkwhale_network.worker.WorkerSettings image: funkwhale/network environment: - "DB_DSN=${DB_DSN-user=postgres password=postgres dbname=funkwhale_network host=db}" diff --git a/funkwhale_network/settings.py b/funkwhale_network/settings.py index d0869dd0e7bc84bb3c7362c1177a06b4f80d8502..9e6670ecfc9a2fd1382c484b0e401509dfcbd94a 100644 --- a/funkwhale_network/settings.py +++ b/funkwhale_network/settings.py @@ -1,4 +1,5 @@ import environ +from arq.connections import RedisSettings env = environ.Env() env_file = env("ENV_FILE", default=None) @@ -22,9 +23,9 @@ from funkwhale_network import middlewares MIDDLEWARES = [middlewares.conn_middleware] PORT = env.int("APP_PORT", default=8000) GF_SERVER_ROOT_URL = env("GF_SERVER_ROOT_URL", default="/dashboards/") -REDIS_CONFIG = { - "host": env("REDIS_HOST", default="localhost"), - "port": env.int("REDIS_PORT", default=6379), - "database": env.int("REDIS_DB", default=0), - "password": env("REDIS_PASSWORD", default=None), -} +REDIS_CONFIG = RedisSettings( + host=env("REDIS_HOST", default="localhost"), + port=env.int("REDIS_PORT", default=6379), + database=env.int("REDIS_DB", default=0), + password=env("REDIS_PASSWORD", default=None), +) diff --git a/funkwhale_network/worker.py b/funkwhale_network/worker.py index 8a2cace5b9d653c7745ca058d9ae053963a6afde..5cafe50c053918baa4c264dc758164ccd8e3b52f 100644 --- a/funkwhale_network/worker.py +++ b/funkwhale_network/worker.py @@ -26,3 +26,4 @@ class WorkerSettings: max_concurrent_tasks = 20 shutdown_delay = 5 timeout_seconds = 15 + redis_settings = settings.REDIS_CONFIG