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

Async Symfony Messenger #681

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Async Symfony Messenger #681

wants to merge 2 commits into from

Conversation

k-37
Copy link

@k-37 k-37 commented Oct 27, 2024

This is proposal to fix issue #539 based on my interpretation of conversation in the issue.

Comment on lines +4 to +14
```yaml
php-worker:
image: ${IMAGES_PREFIX:-}app-php-worker
restart: unless-stopped
environment:
- RUN_MIGRATIONS=false
healthcheck:
disable: true
depends_on:
- php
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```yaml
php-worker:
image: ${IMAGES_PREFIX:-}app-php-worker
restart: unless-stopped
environment:
- RUN_MIGRATIONS=false
healthcheck:
disable: true
depends_on:
- php
```
```yaml
php-worker:
image: ${IMAGES_PREFIX:-}app-php-worker
restart: unless-stopped
environment:
- RUN_MIGRATIONS=false
healthcheck:
disable: true
depends_on:
- php

Comment on lines +45 to +52
```yaml
php-worker:
build:
context: .
target: frankenphp_prod
environment:
APP_SECRET: ${APP_SECRET}
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```yaml
php-worker:
build:
context: .
target: frankenphp_prod
environment:
APP_SECRET: ${APP_SECRET}
```
```yaml
php-worker:
build:
context: .
target: frankenphp_prod
environment:
APP_SECRET: ${APP_SECRET}

Comment on lines +57 to +58
+ run_migrations=${RUN_MIGRATIONS:-true}
+ if grep -q ^DATABASE_URL= .env && [ "$run_migrations" = "true" ]; then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe combine these lines into one?

Suggested change
+ run_migrations=${RUN_MIGRATIONS:-true}
+ if grep -q ^DATABASE_URL= .env && [ "$run_migrations" = "true" ]; then
+ if grep -q ^DATABASE_URL= .env && [ "${RUN_MIGRATIONS:-true}" = "true" ]; then

@7-zete-7
Copy link

Great work, @k-37!

Do you think it makes sense to create a new entrypoint for the php-worker service, so that the --time-limit, --limit and --memory-limit parameters can be set via environment variables, and transports (and additional parameters) via the command parameter?

   php-worker:
     # ...
     environment:
       - RUN_MIGRATIONS=false
       - CONSUMER_TIME_LIMIT=60
       - CONSUMER_LIMIT=10
       - CONSUMER_MEMORY_LIMIT=128M
     command: ['async']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants