Просмотр исходного кода

fix: wire QdrantCleanupService.performCleanup into the scheduler

The previous commit added orphan-point pruning to performCleanup but the
scheduler's runCleanupTask never invoked it — it only ran the inline
deletion-queue + error-log cleanup. As a result both the daily cron and
the manual POST /api/qdrant/cleanup endpoint returned success without
actually pruning orphans or processing the deferred deletion queue.

runCleanupTask now awaits cleanupService.performCleanup() after its own
work and logs the resulting stats.
fszontagh 2 месяцев назад
Родитель
Сommit
146f375ddc
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      src/services/SchedulerService.ts

+ 7 - 0
src/services/SchedulerService.ts

@@ -182,6 +182,13 @@ export class SchedulerService {
       const errorsCleaned = this.database.cleanupQdrantErrors(thirtyDaysAgo.toISOString());
       const errorsCleaned = this.database.cleanupQdrantErrors(thirtyDaysAgo.toISOString());
       logger.debug(`Cleaned up ${errorsCleaned} old error records`);
       logger.debug(`Cleaned up ${errorsCleaned} old error records`);
 
 
+      // Delegate Qdrant-specific work (process deletion queue items past their
+      // delay, prune orphan points, archive MCP logs, etc.). The scheduler used
+      // to skip this entirely, so manual triggers via POST /api/qdrant/cleanup
+      // were silently a no-op for orphan points.
+      const qdrantStats = await this.cleanupService.performCleanup();
+      logger.info('Qdrant cleanup stats:', qdrantStats);
+
       // Update last cleanup time
       // Update last cleanup time
       this.updateLastTaskTime('cleanup');
       this.updateLastTaskTime('cleanup');