mirror of
https://github.com/Hestia-Homes/insight.git
synced 2026-06-08 11:17:25 +00:00
re made appointments
This commit is contained in:
parent
05b1a018b7
commit
f996ded11c
3 changed files with 7 additions and 7 deletions
|
|
@ -52,7 +52,7 @@ async def main():
|
|||
await queue.put(deal_id)
|
||||
|
||||
# PROPER concurrency — same as semaphore limit
|
||||
NUM_WORKERS = 10
|
||||
NUM_WORKERS = 5
|
||||
|
||||
pbar = tqdm(total=total, desc="Fetching Deals", unit="deal", dynamic_ncols=True)
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ async def main():
|
|||
await queue.put(deal_id)
|
||||
|
||||
# PROPER concurrency — same as semaphore limit
|
||||
NUM_WORKERS = 10
|
||||
NUM_WORKERS = 5
|
||||
|
||||
pbar = tqdm(total=total, desc="Fetching Deals", unit="deal", dynamic_ncols=True)
|
||||
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ import random
|
|||
|
||||
|
||||
class HubSpotClientAsync:
|
||||
API_CONCURRENCY = asyncio.Semaphore(10) # globally limit concurrency
|
||||
API_CONCURRENCY = asyncio.Semaphore(5) # globally limit concurrency
|
||||
RATE_LIMIT_DELAY = 0.25 # 4 requests/sec → safe
|
||||
BASE_BACKOFF = 0.5 # seconds
|
||||
MAX_BACKOFF = 10.0 # cap sleep
|
||||
BASE_BACKOFF = 10.00 # secon
|
||||
MIN_BACKOFF = 10.00 # cap sle
|
||||
MAX_RETRIES = 5
|
||||
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ class HubSpotClientAsync:
|
|||
self.MAX_BACKOFF,
|
||||
self.BASE_BACKOFF * (2 ** (attempt - 1))
|
||||
)
|
||||
jitter = random.uniform(0, backoff)
|
||||
jitter = random.uniform(10, 10 + backoff)
|
||||
|
||||
self.logger.warning(
|
||||
f"HubSpot retry {attempt}/{self.MAX_RETRIES} "
|
||||
|
|
@ -298,7 +298,7 @@ class HubSpotClientAsync:
|
|||
"deals",
|
||||
deal_id,
|
||||
"line_items",
|
||||
limit=100,
|
||||
limit=10,
|
||||
)
|
||||
|
||||
if not response.results:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue