@@ -132,6 +132,7 @@ func (j *EventProcessorJob) embeddingProcessWorkspaces(ctx context.Context) {
132132 }
133133 if codebaseEnv .Switch == dto .SwitchOff {
134134 j .logger .Info ("codebase is disabled, skipping embedding process" )
135+ time .Sleep (time .Second * 10 )
135136 return
136137 }
137138
@@ -147,9 +148,9 @@ func (j *EventProcessorJob) embeddingProcessWorkspaces(ctx context.Context) {
147148 return
148149 }
149150
150- workspackePaths := make ([]string , len (workspaces ))
151+ workspacePaths := make ([]string , len (workspaces ))
151152 for i , workspace := range workspaces {
152- workspackePaths [i ] = workspace .WorkspacePath
153+ workspacePaths [i ] = workspace .WorkspacePath
153154 }
154155
155156 // 在处理事件前再次检查上下文是否已取消
@@ -161,7 +162,7 @@ func (j *EventProcessorJob) embeddingProcessWorkspaces(ctx context.Context) {
161162 // 继续执行
162163 }
163164
164- err = j .embedding .ProcessEmbeddingEvents (j .ctx , workspackePaths )
165+ err = j .embedding .ProcessEmbeddingEvents (j .ctx , workspacePaths )
165166 if err != nil {
166167 j .logger .Error ("failed to process embedding events: %v" , err )
167168 }
@@ -176,6 +177,20 @@ func (j *EventProcessorJob) codegraphProcessWorkSpaces(ctx context.Context) erro
176177 default :
177178 // 继续执行
178179 }
180+
181+ // 检查是否关闭codebase
182+ codebaseEnv := j .storage .GetCodebaseEnv ()
183+ if codebaseEnv == nil {
184+ codebaseEnv = & config.CodebaseEnv {
185+ Switch : dto .SwitchOn ,
186+ }
187+ }
188+ if codebaseEnv .Switch == dto .SwitchOff {
189+ j .logger .Info ("codebase is disabled, skipping codegraph process" )
190+ time .Sleep (time .Second * 10 )
191+ return nil
192+ }
193+
179194 // 获取活跃工作区
180195 workspaces , err := j .codegraph .ProcessActiveWorkspaces (j .ctx )
181196 if err != nil {
0 commit comments