|
7 | 7 | "strings" |
8 | 8 | "time" |
9 | 9 |
|
10 | | - "github.com/sdcio/data-server/pkg/config" |
11 | 10 | "github.com/sdcio/data-server/pkg/datastore/types" |
12 | 11 | "github.com/sdcio/data-server/pkg/tree" |
13 | 12 | treeproto "github.com/sdcio/data-server/pkg/tree/importer/proto" |
|
23 | 22 | ErrValidationError = errors.New("validation error") |
24 | 23 | ) |
25 | 24 |
|
26 | | -const ( |
27 | | - ConcurrentValidate = false |
28 | | -) |
29 | | - |
30 | 25 | // SdcpbTransactionIntentToInternalTI converts sdcpb.TransactionIntent to types.TransactionIntent |
31 | 26 | func (d *Datastore) SdcpbTransactionIntentToInternalTI(ctx context.Context, req *sdcpb.TransactionIntent) (*types.TransactionIntent, error) { |
32 | 27 |
|
@@ -96,7 +91,7 @@ func (d *Datastore) replaceIntent(ctx context.Context, transaction *types.Transa |
96 | 91 | log.TraceFn(func() []interface{} { return []interface{}{root.String()} }) |
97 | 92 |
|
98 | 93 | // perform validation |
99 | | - validationResult := root.Validate(ctx, &config.Validation{DisableConcurrency: !ConcurrentValidate}) |
| 94 | + validationResult := root.Validate(ctx, d.config.Validation) |
100 | 95 | validationResult.ErrorsStr() |
101 | 96 | if validationResult.HasErrors() { |
102 | 97 | return nil, validationResult.JoinErrors() |
@@ -126,7 +121,7 @@ func (d *Datastore) replaceIntent(ctx context.Context, transaction *types.Transa |
126 | 121 | func (d *Datastore) LoadAllButRunningIntents(ctx context.Context, root *tree.RootEntry) ([]string, error) { |
127 | 122 |
|
128 | 123 | intentNames := []string{} |
129 | | - IntentChan := make(chan *tree_persist.Intent, 0) |
| 124 | + IntentChan := make(chan *tree_persist.Intent) |
130 | 125 | ErrChan := make(chan error, 1) |
131 | 126 |
|
132 | 127 | go d.cacheClient.IntentGetAll(ctx, []string{"running"}, IntentChan, ErrChan) |
@@ -223,7 +218,7 @@ func (d *Datastore) lowlevelTransactionSet(ctx context.Context, transaction *typ |
223 | 218 | log.Debug(root.String()) |
224 | 219 |
|
225 | 220 | // perform validation |
226 | | - validationResult := root.Validate(ctx, &config.Validation{DisableConcurrency: !ConcurrentValidate}) |
| 221 | + validationResult := root.Validate(ctx, d.config.Validation) |
227 | 222 |
|
228 | 223 | // prepare the response struct |
229 | 224 | result := &sdcpb.TransactionSetResponse{ |
|
0 commit comments