Skip to content

Commit 2328c53

Browse files
committed
Stress that worker uses Queue.slug instead of Queue.name
1 parent c297d33 commit 2328c53

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

docker-compose.test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ services:
104104
dockerfile: docker/Dockerfile.worker
105105
context: .
106106
target: test
107-
command: --loglevel=info -Q test_queue
107+
command: --loglevel=info -Q 123-test_queue
108108
entrypoint: [coverage, run, -m, celery, -A, tests.test_integration.celery_test, worker, --max-tasks-per-child=1]
109109
env_file:
110110
- .env.docker

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ services:
8383
context: .
8484
target: prod
8585
env_file: .env.docker
86-
command: --loglevel=info -Q test_queue
86+
command: --loglevel=info -Q 123-test_queue # Queue.slug
8787
depends_on:
8888
db:
8989
condition: service_healthy

docs/reference/worker/index.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ executes them and updates status & log url in :ref:`database`. Implemented using
1212
This can be done via :ref:`frontend` or via :ref:`server` REST API.
1313

1414
Queue field ``slug`` value is then should be passed to Celery argument ``-Q``.
15-
For example, for slug ``test_queue`` this should be ``-Q test_queue``.
15+
For example, for slug ``123-test_queue`` this should be ``-Q 123-test_queue``.
1616

1717
Install & run
1818
-------------
@@ -70,18 +70,20 @@ Without docker
7070
7171
$ pip install syncmaster[server,worker]
7272
73-
* Start :ref:`server` and :ref:`frontend`, create Group and Queue, get slug (e.g. ``test_queue``)
73+
* Start :ref:`server` and :ref:`frontend`
74+
* Create new Group
75+
* Create Queue in this group, and then get **Queue.slug** (e.g. ``123-test_queue``)
7476
* Run worker process:
7577

7678
.. code-block:: console
7779
78-
$ python -m celery -A syncmaster.worker.celery worker -Q test_queue --max-tasks-per-child=1
80+
$ python -m celery -A syncmaster.worker.celery worker -Q 123-test_queue --max-tasks-per-child=1
7981
8082
You can specify options like concurrency and queues by adding additional flags:
8183

8284
.. code-block:: bash
8385
84-
$ python -m celery -A syncmaster.worker.celery worker -Q test_queue --max-tasks-per-child=1 --concurrency=4 --loglevel=info
86+
$ python -m celery -A syncmaster.worker.celery worker -Q 123-test_queue --max-tasks-per-child=1 --concurrency=4 --loglevel=info
8587
8688
Refer to the `Celery <https://docs.celeryq.dev/en/stable/>`_ documentation for more advanced start options.
8789

tests/test_integration/test_run_transfer/connection_fixtures/connection_fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def group(
4444
await session.commit()
4545

4646

47-
@pytest_asyncio.fixture(params=["test_queue"])
47+
@pytest_asyncio.fixture(params=["123-test_queue"])
4848
async def queue(
4949
request: FixtureRequest,
5050
session: AsyncSession,

tests/test_integration/test_scheduler/scheduler_fixtures/transfer_fixture.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ async def group_transfer_integration_mock(
4545

4646
queue = await create_queue(
4747
session=session,
48-
name="test_queue",
48+
name="123-test_queue",
4949
group_id=group.id,
50-
slug="test_queue",
50+
slug="123-test_queue",
5151
)
5252

5353
members: list[MockUser] = []

0 commit comments

Comments
 (0)