remove time

This commit is contained in:
Jun-te Kim 2026-04-02 10:21:22 +00:00
parent e1ea6f79f9
commit 4c696c3d4c

View file

@ -2,7 +2,6 @@ from etl.hubspot.hubspotClient import HubspotClient, Companies, Pipeline
from etl.hubspot.scripts.scraper.main import handler
from tqdm import tqdm
import json
import time
PIPELINE_ID = Pipeline.OPERATIONS_SOCIAL_HOUSING.value
@ -29,13 +28,14 @@ def bulk_load(companies: list[Companies] | None = None) -> None:
deal_ids = hubspot.get_deal_ids_from_company(company_id)
processed = 0
with tqdm(deal_ids, desc=company.name, unit="deal", leave=True, position=0) as deal_bar:
with tqdm(
deal_ids, desc=company.name, unit="deal", leave=True, position=0
) as deal_bar:
for deal_id in deal_bar:
deal_data = hubspot.from_deal_id_get_info(deal_id)
if deal_data.get("pipeline") != PIPELINE_ID:
deal_bar.set_postfix({"status": "skip", "deal": deal_id})
continue
time.sleep(5)
deal_bar.set_postfix({"status": "uploading", "deal": deal_id})
handler(
{"Records": [{"body": json.dumps({"hubspot_deal_id": deal_id})}]},