Skip to content

Commit

Permalink
Merge branch 'master' into sleek-sparkline
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes committed Jan 17, 2024
2 parents 211f6b8 + 9209a5d commit 36789e1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ee/tasks/subscriptions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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

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

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 36789e1

Please sign in to comment.