Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
prenner committed Jan 9, 2025
1 parent fed5dec commit 928ddce
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions python-threatexchange/threatexchange/exchanges/impl/ncmec_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ def log(event: str) -> None:
updates: t.List[api.NCMECEntryUpdate] = []
for i, entry in enumerate(
client.get_entries_iter(
start_timestamp=current_start, end_timestamp=current_end, next_=current_next_fetch,
start_timestamp=current_start,
end_timestamp=current_end,
next_=current_next_fetch,
)
):
if i == 0: # First batch, check for overfetch
Expand Down Expand Up @@ -315,8 +317,11 @@ def log(event: str) -> None:
log(f"large fetch ({i}), up to {len(updates)}. storing checkpoint")
yield state.FetchDelta(
{f"{entry.member_id}-{entry.id}": entry for entry in updates},
NCMECCheckpoint(get_entries_max_ts=current_start, next_fetch=entry.next, last_fetch_time=int(time.time())),

NCMECCheckpoint(
get_entries_max_ts=current_start,
next_fetch=entry.next,
last_fetch_time=int(time.time()),
),
)
current_next_fetch = entry.next
updates = []
Expand All @@ -342,7 +347,11 @@ def log(event: str) -> None:
low_fetch_counter = 0
yield state.FetchDelta(
{f"{entry.member_id}-{entry.id}": entry for entry in updates},
NCMECCheckpoint(get_entries_max_ts=current_end, next_fetch="", last_fetch_time=int(time.time())),
NCMECCheckpoint(
get_entries_max_ts=current_end,
next_fetch="",
last_fetch_time=int(time.time()),
),
)
current_start = current_end
current_next_fetch = ""
Expand Down

0 comments on commit 928ddce

Please sign in to comment.