@@ -250,9 +250,10 @@ func (p *Config) indexProjectTools(
250250 return fmt .Errorf ("project tool at index %d missing id" , i )
251251 }
252252 key := resources.ResourceKey {Project : p .Name , Type : resources .ResourceTool , ID : tool .ID }
253- value := tool
253+ keyCopy := key
254+ toolCopy := tool
254255 group .Go (func () error {
255- return p .putResourceWithMeta (ctx , store , metaSources , key , value )
256+ return p .putResourceWithMeta (ctx , store , metaSources , keyCopy , toolCopy )
256257 })
257258 }
258259 return nil
@@ -279,9 +280,10 @@ func (p *Config) indexProjectMemories(
279280 return fmt .Errorf ("memory '%s' validation failed: %w" , memory .ID , err )
280281 }
281282 key := resources.ResourceKey {Project : p .Name , Type : resources .ResourceMemory , ID : memory .ID }
282- value := memory
283+ keyCopy := key
284+ mem := memory
283285 group .Go (func () error {
284- return p .putResourceWithMeta (ctx , store , metaSources , key , value )
286+ return p .putResourceWithMeta (ctx , store , metaSources , keyCopy , mem )
285287 })
286288 }
287289 return nil
@@ -301,9 +303,10 @@ func (p *Config) indexProjectSchemas(
301303 continue
302304 }
303305 key := resources.ResourceKey {Project : p .Name , Type : resources .ResourceSchema , ID : sid }
304- value := schemaValue
306+ keyCopy := key
307+ schemaCopy := schemaValue
305308 group .Go (func () error {
306- return p .putResourceWithMeta (ctx , store , metaSources , key , value )
309+ return p .putResourceWithMeta (ctx , store , metaSources , keyCopy , schemaCopy )
307310 })
308311 }
309312 return nil
@@ -323,9 +326,10 @@ func (p *Config) indexProjectModels(
323326 }
324327 id := fmt .Sprintf ("%s:%s" , string (model .Provider ), model .Model )
325328 key := resources.ResourceKey {Project : p .Name , Type : resources .ResourceModel , ID : id }
326- value := model
329+ keyCopy := key
330+ modelCopy := model
327331 group .Go (func () error {
328- return p .putResourceWithMeta (ctx , store , metaSources , key , value )
332+ return p .putResourceWithMeta (ctx , store , metaSources , keyCopy , modelCopy )
329333 })
330334 }
331335 return nil
@@ -343,9 +347,10 @@ func (p *Config) indexProjectEmbedders(
343347 return fmt .Errorf ("project embedder at index %d missing id" , i )
344348 }
345349 key := resources.ResourceKey {Project : p .Name , Type : resources .ResourceEmbedder , ID : embedder .ID }
346- value := embedder
350+ keyCopy := key
351+ embedderCopy := embedder
347352 group .Go (func () error {
348- return p .putResourceWithMeta (ctx , store , metaSources , key , value )
353+ return p .putResourceWithMeta (ctx , store , metaSources , keyCopy , embedderCopy )
349354 })
350355 }
351356 return nil
@@ -363,9 +368,10 @@ func (p *Config) indexProjectVectorDBs(
363368 return fmt .Errorf ("project vector_db at index %d missing id" , i )
364369 }
365370 key := resources.ResourceKey {Project : p .Name , Type : resources .ResourceVectorDB , ID : vectorDB .ID }
366- value := vectorDB
371+ keyCopy := key
372+ vectorDBCopy := vectorDB
367373 group .Go (func () error {
368- return p .putResourceWithMeta (ctx , store , metaSources , key , value )
374+ return p .putResourceWithMeta (ctx , store , metaSources , keyCopy , vectorDBCopy )
369375 })
370376 }
371377 return nil
@@ -386,9 +392,10 @@ func (p *Config) indexProjectKnowledgeBases(
386392 knowledgeBase .Ingest = knowledge .IngestManual
387393 }
388394 key := resources.ResourceKey {Project : p .Name , Type : resources .ResourceKnowledgeBase , ID : knowledgeBase .ID }
389- value := knowledgeBase
395+ keyCopy := key
396+ knowledgeBaseCopy := knowledgeBase
390397 group .Go (func () error {
391- return p .putResourceWithMeta (ctx , store , metaSources , key , value )
398+ return p .putResourceWithMeta (ctx , store , metaSources , keyCopy , knowledgeBaseCopy )
392399 })
393400 }
394401 return nil
0 commit comments