refactor(knowledge): migrate deleted-item cleanup from polling scheduler to event-driven worker
Replaces the scheduler-polled KnowledgeDeletedCleanupWorker with an event-driven KnowledgeDeletedCleanupEventWorker in tenant-api; cleanup events are now enqueued transactionally at delete time instead of swept periodically. Also fixes statement_timeout parameterization in MonitoringRetentionWorker and propagates errors from cleanupDeletedKnowledgeItem. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -42,6 +42,19 @@ func main() {
|
||||
tenantapp.NewDesktopAccountHealthSinkWorker(app.DB, app.RabbitMQ, app.Logger).Start(workerCtx)
|
||||
imageService := tenantapp.NewImageService(app.DB, app.ObjectStorage, app.RabbitMQ, app.Logger)
|
||||
tenantapp.NewImageAssetWorker(imageService, app.RabbitMQ, app.Logger).Start(workerCtx)
|
||||
knowledgeCleanupService := tenantapp.NewKnowledgeService(
|
||||
app.DB,
|
||||
app.RetrievalProvider,
|
||||
app.VectorStore,
|
||||
app.ObjectStorage,
|
||||
app.LLM,
|
||||
app.Logger,
|
||||
app.Config().Retrieval,
|
||||
app.Config().LLM,
|
||||
0,
|
||||
0,
|
||||
).WithConfigProvider(app.ConfigStore)
|
||||
tenantapp.NewKnowledgeDeletedCleanupEventWorker(knowledgeCleanupService, app.Logger).Start(workerCtx)
|
||||
|
||||
transport.RegisterRoutes(app)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user