Some checks failed
build-images / web (push) Has been cancelled
vision2026-ci / Python SDK resource tests (push) Has been cancelled
build-images / api (push) Has been cancelled
build-images / worker-gpu (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Has been cancelled
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Has been cancelled
codeql / Analyze (javascript-typescript) (push) Has been cancelled
codeql / Analyze (python) (push) Has been cancelled
perf / API hot-path micro-smoke (budgeted) (push) Has been cancelled
perf / Desktop engine crates (release build check) (push) Has been cancelled
vision2026-ci / API phase modules (ruff + pytest) (push) Has been cancelled
vision2026-ci / Alembic upgrade + drift check (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Has been cancelled
Paid, hosted product at menivor.com, now retired as a company project. Fresh squashed history of the cleaned working tree (secret-scanned, no .env, no customer data, no outreach logs). Built on MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
45 lines
1.7 KiB
Python
45 lines
1.7 KiB
Python
"""Celery beat: activation funnel sync + weekly owner funnel email + daily digest.
|
|
|
|
* ``funnel_tick_task`` runs daily at 07:00 UTC and hourly 07:30-11:30 UTC on
|
|
Mondays. Each tick records new first-time funnel steps; on Monday from 07:00
|
|
UTC it sends the week's owner funnel email once (a failed send is retried by
|
|
the next Monday tick). Never raises, so a bad tick cannot crash beat.
|
|
* ``funnel_digest_task`` runs daily at 07:10 UTC: sends yesterday's funnel
|
|
digest (signups/card-checks/reels) once per UTC calendar day (a failed send
|
|
is retried by the next day's tick, same claim/release pattern as the weekly
|
|
email). Never raises.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from loguru import logger
|
|
|
|
from app.workers.celery_app import celery_app
|
|
|
|
FUNNEL_TASK = "app.workers.tasks_funnel.funnel_tick_task"
|
|
FUNNEL_DIGEST_TASK = "app.workers.tasks_funnel.funnel_digest_task"
|
|
|
|
|
|
@celery_app.task(name=FUNNEL_TASK, soft_time_limit=240, time_limit=270)
|
|
def funnel_tick_task() -> dict:
|
|
try:
|
|
from app.services.funnel import weekly
|
|
|
|
return weekly.run()
|
|
except Exception as exc: # noqa: BLE001 - never crash the beat worker
|
|
logger.error(f"funnel_tick_task failed: {type(exc).__name__}: {exc}")
|
|
return {"status": "error"}
|
|
|
|
|
|
@celery_app.task(name=FUNNEL_DIGEST_TASK, soft_time_limit=240, time_limit=270)
|
|
def funnel_digest_task() -> dict:
|
|
try:
|
|
from app.services.funnel import weekly
|
|
|
|
return weekly.run_daily_digest()
|
|
except Exception as exc: # noqa: BLE001 - never crash the beat worker
|
|
logger.error(f"funnel_digest_task failed: {type(exc).__name__}: {exc}")
|
|
return {"status": "error"}
|
|
|
|
# Beat entries and the queue route live in app/workers/celery_app.py.
|