chore: align slurp config and scaffolding
This commit is contained in:
@@ -3,18 +3,19 @@ package storage
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"chorus/pkg/ucxl"
|
||||
slurpContext "chorus/pkg/slurp/context"
|
||||
"chorus/pkg/ucxl"
|
||||
)
|
||||
|
||||
// BatchOperationsImpl provides efficient batch operations for context storage
|
||||
type BatchOperationsImpl struct {
|
||||
contextStore *ContextStoreImpl
|
||||
batchSize int
|
||||
maxConcurrency int
|
||||
contextStore *ContextStoreImpl
|
||||
batchSize int
|
||||
maxConcurrency int
|
||||
operationTimeout time.Duration
|
||||
}
|
||||
|
||||
@@ -22,8 +23,8 @@ type BatchOperationsImpl struct {
|
||||
func NewBatchOperations(contextStore *ContextStoreImpl, batchSize, maxConcurrency int, timeout time.Duration) *BatchOperationsImpl {
|
||||
return &BatchOperationsImpl{
|
||||
contextStore: contextStore,
|
||||
batchSize: batchSize,
|
||||
maxConcurrency: maxConcurrency,
|
||||
batchSize: batchSize,
|
||||
maxConcurrency: maxConcurrency,
|
||||
operationTimeout: timeout,
|
||||
}
|
||||
}
|
||||
@@ -89,7 +90,7 @@ func (cs *ContextStoreImpl) BatchStore(
|
||||
result.ErrorCount++
|
||||
key := workResult.Item.Context.UCXLAddress.String()
|
||||
result.Errors[key] = workResult.Error
|
||||
|
||||
|
||||
if batch.FailOnError {
|
||||
// Cancel remaining operations
|
||||
result.ProcessingTime = time.Since(start)
|
||||
@@ -164,11 +165,11 @@ func (cs *ContextStoreImpl) BatchRetrieve(
|
||||
// Process results
|
||||
for workResult := range resultsCh {
|
||||
addressStr := workResult.Address.String()
|
||||
|
||||
|
||||
if workResult.Error != nil {
|
||||
result.ErrorCount++
|
||||
result.Errors[addressStr] = workResult.Error
|
||||
|
||||
|
||||
if batch.FailOnError {
|
||||
// Cancel remaining operations
|
||||
result.ProcessingTime = time.Since(start)
|
||||
|
||||
Reference in New Issue
Block a user