diff --git a/ee/tasks/subscriptions/__init__.py b/ee/tasks/subscriptions/__init__.py index 235ea70c16d7e..443e5eb369995 100644 --- a/ee/tasks/subscriptions/__init__.py +++ b/ee/tasks/subscriptions/__init__.py @@ -1,7 +1,6 @@ from datetime import datetime, timedelta from typing import Optional -from django.conf import settings import structlog from prometheus_client import Counter from sentry_sdk import capture_exception, capture_message @@ -9,6 +8,7 @@ from ee.tasks.subscriptions.email_subscriptions import send_email_subscription_report from ee.tasks.subscriptions.slack_subscriptions import send_slack_subscription_report from ee.tasks.subscriptions.subscription_utils import generate_assets +from posthog import settings from posthog.celery import app from posthog.models.subscription import Subscription @@ -148,14 +148,12 @@ def schedule_all_subscriptions() -> None: report_timeout_seconds = settings.PARALLEL_ASSET_GENERATION_MAX_TIMEOUT_MINUTES * 60 * 1.5 -@app.task(soft_time_limit=report_timeout_seconds, timeout=report_timeout_seconds + 10) +@app.task(soft_time_limit=report_timeout_seconds, time_limit=report_timeout_seconds + 10) def deliver_subscription_report(subscription_id: int) -> None: - if not settings.TEST: - return return _deliver_subscription_report(subscription_id) -@app.task(soft_time_limit=30, time_limit=40) +@app.task(soft_time_limit=report_timeout_seconds, time_limit=report_timeout_seconds + 10) def handle_subscription_value_change( subscription_id: int, previous_value: str, invite_message: Optional[str] = None ) -> None: