4167687dec
Store last notify time by dedup_key/fingerprint, gate dispatch before channels; config SAC_NOTIFY_*_COOLDOWN_SEC, migration 008. Co-authored-by: Cursor <cursoragent@cursor.com>
17 lines
569 B
Python
17 lines
569 B
Python
from datetime import datetime
|
|
|
|
from sqlalchemy import DateTime, String
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.database import Base
|
|
|
|
|
|
class NotificationCooldown(Base):
|
|
"""Последняя отправка оповещения по ключу (dedup_key / fingerprint)."""
|
|
|
|
__tablename__ = "notification_cooldown"
|
|
|
|
cooldown_key: Mapped[str] = mapped_column(String(512), primary_key=True)
|
|
kind: Mapped[str] = mapped_column(String(16)) # event | problem
|
|
last_notified_at: Mapped[datetime] = mapped_column(DateTime(timezone=True))
|