From 7053c11f695cbe8e0ba6e244cb94832433d01066 Mon Sep 17 00:00:00 2001 From: Eric Duong Date: Wed, 26 Jun 2024 16:13:59 -0400 Subject: [PATCH] chore(data-warehouse): adjust time (#23267) adjust --- posthog/tasks/scheduled.py | 5 +++-- posthog/tasks/warehouse.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/posthog/tasks/scheduled.py b/posthog/tasks/scheduled.py index 16375a759b172..3e302ebe00664 100644 --- a/posthog/tasks/scheduled.py +++ b/posthog/tasks/scheduled.py @@ -322,9 +322,10 @@ def setup_periodic_tasks(sender: Celery, **kwargs: Any) -> None: name="Invalid web replays count", ) - # Every 30 minutes try to retrieve and calculate total rows synced in period + # Every 20 minutes try to retrieve and calculate total rows synced in period + sender.add_periodic_task( - crontab(minute="*/30"), + crontab(minute="*/20"), calculate_external_data_rows_synced.s(), name="calculate external data rows synced", ) diff --git a/posthog/tasks/warehouse.py b/posthog/tasks/warehouse.py index 400f9114f4f8a..699a5c5153c4f 100644 --- a/posthog/tasks/warehouse.py +++ b/posthog/tasks/warehouse.py @@ -19,13 +19,13 @@ MONTHLY_LIMIT = 500_000_000 # TODO: adjust to whenever billing officially starts -DEFAULT_DATE_TIME = datetime.datetime(2024, 7, 31, tzinfo=datetime.timezone.utc) +DEFAULT_DATE_TIME = datetime.datetime(2024, 6, 1, tzinfo=datetime.timezone.utc) @app.task(ignore_result=True) def capture_external_data_rows_synced() -> None: for team in Team.objects.select_related("organization").exclude( - Q(organization__for_internal_metrics=True) | Q(is_demo=True) | Q(external_data_workspace_id__isnull=True) + Q(organization__for_internal_metrics=True) | Q(is_demo=True) ): capture_workspace_rows_synced_by_team.delay(team.pk)