I'm trying to remove CampaignCriterionOperation using BatchJobService.
It used to work quite quick until last Thursday, but now it's very slow it can take 30 minutes before it's done, and the amount of data is the very same.
I see the same issue on uploading CampaignCriteria.
How long should it take to delete let's say 20000 criteria?
I'm using code more less like this:
batch_job_service = client.get_service("BatchJobService")
batch_job_operation = client.get_type("BatchJobOperation")
batch_job = client.get_type("BatchJob")
client.copy_from(batch_job_operation.create, batch_job)
response = batch_job_service.mutate_batch_job(
customer_id=customer_id, operation=batch_job_operation
)
resource_name = response.result.resource_name
operations = []
for cbm in chunk:
campaign_criterion_operation = client.get_type("CampaignCriterionOperation")
campaign_id = cbm.split(',')[0]
criterion_id = cbm.split(',')[1]
campaign_criterion_operation.remove = f"customers/{customer_id}/campaignCriteria/{campaign_id}~{criterion_id}"
mutate_operation = client.get_type("MutateOperation")
client.copy_from(getattr(mutate_operation, "campaign_criterion_operation"), campaign_criterion_operation)
operations.append(mutate_operation)
batch_job_service.add_batch_job_operations(
resource_name=resource_name,
mutate_operations=operations,
)
response = batch_job_service.run_batch_job(resource_name=resource_name)
for i in range(1, 20):
time.sleep(10*i)
if response.done():
...
Cheers,
Jakub