From 942689783f0492f7cc8dc097f2622ef348820c3a Mon Sep 17 00:00:00 2001 From: wizardchen Date: Wed, 17 Dec 2025 19:54:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=9F=A5=E8=AF=86=E5=BA=93=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E6=97=B6=E6=B7=BB=E5=8A=A0=E7=A7=9F=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=88=B0=E4=B8=8A=E4=B8=8B=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/application/service/knowledge.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/application/service/knowledge.go b/internal/application/service/knowledge.go index ec53f49d..200051e2 100644 --- a/internal/application/service/knowledge.go +++ b/internal/application/service/knowledge.go @@ -5232,6 +5232,14 @@ func (s *knowledgeService) ProcessKBClone(ctx context.Context, t *asynq.Task) er // Add tenant ID to context ctx = context.WithValue(ctx, types.TenantIDContextKey, payload.TenantID) + // Get tenant info and add to context + tenantInfo, err := s.tenantRepo.GetTenantByID(ctx, payload.TenantID) + if err != nil { + logger.Errorf(ctx, "Failed to get tenant info: %v", err) + return fmt.Errorf("failed to get tenant info: %w", err) + } + ctx = context.WithValue(ctx, types.TenantInfoContextKey, tenantInfo) + // Check if this is the last retry retryCount, _ := asynq.GetRetryCount(ctx) maxRetry, _ := asynq.GetMaxRetry(ctx)