@@ -20,7 +20,6 @@ import (
2020var (
2121 serialized map [string ]Leaky
2222 BucketPourCache map [string ][]pipeline.Event = make (map [string ][]pipeline.Event )
23- BucketPourTrack bool
2423 bucketPourMu sync.Mutex
2524)
2625
@@ -75,7 +74,7 @@ func GarbageCollectBuckets(deadline time.Time, buckets *Buckets) {
7574 }
7675}
7776
78- func PourItemToBucket (ctx context.Context , bucket * Leaky , holder BucketFactory , buckets * Buckets , parsed * pipeline.Event ) (bool , error ) {
77+ func PourItemToBucket (ctx context.Context , bucket * Leaky , holder BucketFactory , buckets * Buckets , parsed * pipeline.Event , track bool ) (bool , error ) {
7978 var sent bool
8079 var buckey = bucket .Mapkey
8180 var err error
@@ -143,7 +142,7 @@ func PourItemToBucket(ctx context.Context, bucket *Leaky, holder BucketFactory,
143142 select {
144143 case bucket .In <- parsed :
145144 // holder.logger.Tracef("Successfully sent !")
146- if BucketPourTrack {
145+ if track {
147146 evt := deepcopy .Copy (* parsed ).(pipeline.Event )
148147
149148 bucketPourMu .Lock ()
@@ -204,10 +203,10 @@ func LoadOrStoreBucketFromHolder(ctx context.Context, partitionKey string, bucke
204203
205204var orderEvent map [string ]* sync.WaitGroup
206205
207- func PourItemToHolders (ctx context.Context , parsed pipeline.Event , holders []BucketFactory , buckets * Buckets ) (bool , error ) {
206+ func PourItemToHolders (ctx context.Context , parsed pipeline.Event , holders []BucketFactory , buckets * Buckets , track bool ) (bool , error ) {
208207 var ok , condition , poured bool
209208
210- if BucketPourTrack {
209+ if track {
211210 evt := deepcopy .Copy (parsed ).(pipeline.Event )
212211
213212 bucketPourMu .Lock ()
@@ -275,7 +274,7 @@ func PourItemToHolders(ctx context.Context, parsed pipeline.Event, holders []Buc
275274 orderEvent [buckey ].Add (1 )
276275 }
277276
278- ok , err := PourItemToBucket (ctx , bucket , holders [idx ], buckets , & parsed )
277+ ok , err := PourItemToBucket (ctx , bucket , holders [idx ], buckets , & parsed , track )
279278
280279 if bucket .orderEvent {
281280 orderEvent [buckey ].Wait ()
0 commit comments