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

[DOP-22266] - change celery queue name from queue.name to queue.slug #167

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions tests/test_integration/test_run_transfer/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,7 @@ async def queue(
session=session,
name=request.param,
group_id=group.id,
slug=request.param,
)
yield result
await session.delete(result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ async def group_transfer_integration_mock(
session=session,
name="test_queue",
group_id=group.id,
slug="test_queue",
)

members: list[MockUser] = []
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
3 changes: 2 additions & 1 deletion tests/test_unit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,14 @@ async def create_queue(
session: AsyncSession,
name: str,
group_id: int,
slug: str | None = None,
description: str | None = None,
) -> Queue:
queue = Queue(
name=name,
description=description,
group_id=group_id,
slug=f"{group_id}-{name}",
slug=slug if slug is not None else f"{group_id}-{name}",
)
session.add(queue)
await session.commit()
Expand Down
Loading