Files
photo-live/services/api/src/cleanup/cleanup.module.ts
T
浅念 1f2a0c658f feat(ov): windowed dedup visit counting with retention cleanup
Task 8 (P2): POST /public/albums/{token}/visits with visit_sessions
window dedup (VISIT_WINDOW_MINUTES), requestId idempotent replay
(echoes stored outcome; expired beyond VISIT_REQUEST_TTL_MINUTES
rejected), album_stats viewCount/statVersion authority + outbox_stat_events
views snapshots, WS stats.updated broadcast, visitorId+IP fixed-window
rate limit (VISIT_WINDOW_REQUESTS), and ov CleanupModule scheduler
(setInterval, CLEANUP_INTERVAL_MINUTES) deleting like_batches /
visit_requests / visit_sessions past their windows — totals never
touched. Contract prose aligned to replay semantics; constants
VISIT_WINDOW_REQUESTS / CLEANUP_INTERVAL_MINUTES added.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-18 18:14:01 +08:00

17 lines
774 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// services/api/src/cleanup/ —— ov 互动流水清理模块(P2 Task 8)。仅 ov 入口
// 装配(app-ov.module 显式挑选;cn 入口不感知——cn 侧无互动流水表)。
// CleanupService 同时导出:调度(setInterval,见 cleanup.service.ts 头注)
// 与 runCleanupOnce(e2e 直调断言)。语义边界:仅清 like_batches /
// visit_requests / visit_sessions 超窗口行,累计总数(album_stats、
// photos_ov.likeTotal)永不触碰。
import { Module } from '@nestjs/common';
import { OvPrismaModule } from '../prisma-ov/ov-prisma.module';
import { CleanupService } from './cleanup.service';
@Module({
imports: [OvPrismaModule],
providers: [CleanupService],
exports: [CleanupService],
})
export class CleanupModule {}