Skip to content

Commit

Permalink
[DOP-22266] - change celery queue name from queue.name to queue.slug
Browse files Browse the repository at this point in the history
  • Loading branch information
maxim-lixakov committed Dec 11, 2024
1 parent f51242b commit 36f6fb3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions docker/Dockerfile.worker
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RUN apt-get update && apt-get install -y \
libffi-dev \
libkrb5-dev \
krb5-user \
curl \
&& rm -rf /var/lib/apt/lists/*

RUN curl -sSL https://install.python-poetry.org | python3 - \
Expand Down
2 changes: 1 addition & 1 deletion syncmaster/backend/api/v1/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async def start_run(
celery.send_task,
"run_transfer_task",
kwargs={"run_id": run.id},
queue=transfer.queue.name,
queue=transfer.queue.slug,
)
except KombuError as e:
async with unit_of_work:
Expand Down
2 changes: 1 addition & 1 deletion syncmaster/scheduler/transfer_job_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async def send_job_to_celery(transfer_id: int) -> None:
celery.send_task,
"run_transfer_task",
kwargs={"run_id": run.id},
queue=transfer.queue.name,
queue=transfer.queue.slug,
)
except KombuError as e:
async with unit_of_work:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_unit/test_runs/test_create_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def test_developer_plus_can_create_run_of_transfer_his_group(
mock_send_task,
"run_transfer_task",
kwargs={"run_id": run.id},
queue=group_transfer.queue.name,
queue=group_transfer.queue.slug,
)


Expand Down Expand Up @@ -163,7 +163,7 @@ async def test_superuser_can_create_run(
mock_send_task,
"run_transfer_task",
kwargs={"run_id": run.id},
queue=group_transfer.queue.name,
queue=group_transfer.queue.slug,
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async def test_send_job_to_celery_with_success(
mock_send_task,
"run_transfer_task",
kwargs={"run_id": run.id},
queue=group_transfer.queue.name,
queue=group_transfer.queue.slug,
)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_unit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async def create_queue(
name=name,
description=description,
group_id=group_id,
slug=f"{group_id}-{name}",
slug=f"{name}",
)
session.add(queue)
await session.commit()
Expand Down

0 comments on commit 36f6fb3

Please sign in to comment.