Skip to content

Commit 4e09ea9

Browse files
authored
fix: Worker and scheduler startup scanning virtual environment (#1963)
1 parent 0a20bf5 commit 4e09ea9

3 files changed

Lines changed: 36 additions & 6 deletions

File tree

compose/fastapi/start-scheduler

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ set -o errexit
1010
set -o pipefail
1111
set -o nounset
1212

13-
taskiq scheduler scheduler:scheduler -fsd
13+
taskiq scheduler scheduler:scheduler -fsd -tp src/**/tasks.py

compose/fastapi/start-worker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ set -o errexit
1010
set -o pipefail
1111
set -o nounset
1212

13-
taskiq worker worker:worker -fsd
13+
taskiq worker worker:worker -fsd -tp src/**/tasks.py

docker-compose.yaml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,23 @@ services:
9393
entrypoint: /fastapi-entrypoint
9494
command: ['/start-worker']
9595
env_file: .env
96-
volumes:
97-
- ./:/app/
96+
environment:
97+
DATABASE__HOST: postgres
98+
REDIS__HOST: redis
99+
MAILING__MAIL__SERVER: mailhog
100+
RABBITMQ__URL: rabbitmq
101+
develop:
102+
watch:
103+
- action: sync
104+
path: .
105+
target: /app
106+
# Exclude the project virtual environment
107+
ignore:
108+
- .venv/
109+
110+
# Rebuild the image on changes to the `pyproject.toml`
111+
- action: rebuild
112+
path: ./pyproject.toml
98113
depends_on:
99114
- postgres
100115
- redis
@@ -110,8 +125,23 @@ services:
110125
entrypoint: /fastapi-entrypoint
111126
command: ['/start-scheduler']
112127
env_file: .env
113-
volumes:
114-
- ./:/app/
128+
environment:
129+
DATABASE__HOST: postgres
130+
REDIS__HOST: redis
131+
MAILING__MAIL__SERVER: mailhog
132+
RABBITMQ__URL: rabbitmq
133+
develop:
134+
watch:
135+
- action: sync
136+
path: .
137+
target: /app
138+
# Exclude the project virtual environment
139+
ignore:
140+
- .venv/
141+
142+
# Rebuild the image on changes to the `pyproject.toml`
143+
- action: rebuild
144+
path: ./pyproject.toml
115145
depends_on:
116146
- postgres
117147
- redis

0 commit comments

Comments
 (0)