Skip to content
Open
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
8 changes: 4 additions & 4 deletions src/sentry/runner/commands/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,7 @@ def _cleanup(
partition_total: int | None = None,
partition_key: str = "id",
) -> None:
start_time = time.time()
_validate_and_setup_environment(concurrency, silent)

# Validate partition flags
# Validate partition flags before modifying environment
parsed_partition: tuple[int, int, str] | None = None
if partition_bucket is not None or partition_total is not None:
if partition_bucket is None or partition_total is None:
Expand All @@ -324,6 +321,9 @@ def _cleanup(
f"Invalid --partition-bucket: {partition_bucket} must be less than --partition-total {partition_total}."
)
parsed_partition = (partition_bucket, partition_total, partition_key)

start_time = time.time()
_validate_and_setup_environment(concurrency, silent)
# Make sure we fork off multiprocessing pool
# before we import or configure the app
pool, task_queue = _start_pool(concurrency)
Expand Down
Loading