/** * Cleanup Scheduler * * 주기적으로 cleanupMemories()를 실행하는 스케줄러. * SyncScheduler 패턴 기반. */ import type { LifecycleConfig } from '../types/index.js'; import type { MemoryDatabase } from '../db/database.js'; import type { HookLogger } from '../utils/logger.js'; import { type CleanupResult } from './cleanup.js'; export interface CleanupSchedulerOptions { /** cleanup 주기 (ms). 기본: 3600000 (1시간). 0이면 비활성 */ intervalMs: number; /** 시작 시 즉시 cleanup 실행 여부. 기본: false */ cleanupOnStart?: boolean; /** cleanup 완료 콜백 */ onCleanup?: (result: CleanupResult) => void; /** 에러 콜백 */ onError?: (error: Error) => void; /** * #68 (ADR-050): 서버 미push(pending) 메모리를 삭제 대상에서 제외. * sync가 실제 동작하는 환경에서만 켤 것 (`isSyncActive(config)`) — 자세한 내용은 CleanupOptions 참조. */ protectUnsynced?: boolean; } export interface CleanupSchedulerStatus { running: boolean; cleaning: boolean; cleanupCount: number; lastCleanupAt: string | null; lastResult: CleanupResult | null; intervalMs: number; nextCleanupAt: string | null; } export declare class CleanupScheduler { private db; private config; private options; private logger?; private timer; private running; private cleaning; private cleanupCount; private lastCleanupAt; private lastResult; private startedAt; constructor(db: MemoryDatabase, config: LifecycleConfig, options: CleanupSchedulerOptions, logger?: HookLogger | undefined); /** * 스케줄러 시작 */ start(): Promise; /** * 스케줄러 중지 */ stop(): void; /** * 실행 중 여부 */ isRunning(): boolean; /** * 스케줄러 상태 */ getStatus(): CleanupSchedulerStatus; /** * 수동으로 즉시 cleanup 실행 (스케줄러 타이머와 무관) */ cleanupNow(): Promise; /** * 한 번의 cleanup 사이클 */ private tick; } //# sourceMappingURL=cleanup-scheduler.d.ts.map