Commit 1d6d553 1 parent 74e27b6 commit 1d6d553 Copy full SHA for 1d6d553
File tree 1 file changed +10
-1
lines changed
worker/pkg/workflows/ee/piidetect/workflows/job
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 9
9
mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
10
10
piidetect_job_activities "github.com/nucleuscloud/neosync/worker/pkg/workflows/ee/piidetect/workflows/job/activities"
11
11
piidetect_table_workflow "github.com/nucleuscloud/neosync/worker/pkg/workflows/ee/piidetect/workflows/table"
12
+ "github.com/spf13/viper"
12
13
"go.temporal.io/sdk/log"
13
14
"go.temporal.io/sdk/temporal"
14
15
"go.temporal.io/sdk/workflow"
@@ -139,7 +140,7 @@ func (w *Workflow) orchestrateTables(
139
140
140
141
workselector := workflow .NewNamedSelector (ctx , "job_pii_detect" )
141
142
142
- maxConcurrency := 3
143
+ maxConcurrency := getTablePiiDetectMaxConcurrency ()
143
144
inFlightLimiter := workflow .NewSemaphore (ctx , int64 (maxConcurrency ))
144
145
145
146
tableWf := piidetect_table_workflow .New ()
@@ -230,3 +231,11 @@ var invalidWorkflowIDChars = regexp.MustCompile(`[^a-zA-Z0-9_\-]`)
230
231
func sanitizeWorkflowID (id string ) string {
231
232
return invalidWorkflowIDChars .ReplaceAllString (id , "_" )
232
233
}
234
+
235
+ func getTablePiiDetectMaxConcurrency () int {
236
+ maxConcurrency := viper .GetInt ("TABLE_PII_DETECT_MAX_CONCURRENCY" )
237
+ if maxConcurrency <= 0 {
238
+ return 3 // default max concurrency
239
+ }
240
+ return maxConcurrency
241
+ }
You can’t perform that action at this time.
0 commit comments