Skip to content

Commit

Permalink
typing
Browse files Browse the repository at this point in the history
  • Loading branch information
EDsCODE committed Dec 21, 2023
1 parent d0efae5 commit 9c6647a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions posthog/tasks/warehouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,13 @@ def check_synced_row_limits() -> None:
@app.task(ignore_result=True)
def check_synced_row_limits_of_team(team_id: int) -> None:
start_of_month = datetime.datetime.now().replace(day=1, hour=0, minute=0, second=0, microsecond=0)
rows_synced_list: list[int] = ExternalDataJob.objects.filter(
team_id=team_id, created_at__gte=start_of_month
).values_list("rows_synced", flat=True)
rows_synced_list = [
x
for x in ExternalDataJob.objects.filter(team_id=team_id, created_at__gte=start_of_month).values_list(
"rows_synced", flat=True
)
if x
]
total_rows_synced = sum(rows_synced_list)

if total_rows_synced > MONTHLY_LIMIT:
Expand Down

0 comments on commit 9c6647a

Please sign in to comment.