dograh/api/services/campaign/errors.py
Abhishek 6827744327
fix: make campaign process batch thread safe (#141)
* fix: dont schedule new batch on resume

* fix: make process_batch thread safe
2026-01-30 14:48:00 +05:30

16 lines
565 B
Python

"""
Campaign service exceptions.
"""
class ConcurrentSlotAcquisitionError(Exception):
"""Raised when a concurrent call slot cannot be acquired within the timeout period."""
def __init__(self, organization_id: int, campaign_id: int, wait_time: float):
self.organization_id = organization_id
self.campaign_id = campaign_id
self.wait_time = wait_time
super().__init__(
f"Failed to acquire concurrent slot for org {organization_id}, "
f"campaign {campaign_id} after waiting {wait_time:.1f}s"
)