This commit is contained in:
		| @@ -7,7 +7,8 @@ import ( | ||||
| 	"time" | ||||
|  | ||||
| 	m "git.k-space.ee/k-space/logmower-shipper/pkg/mongo" | ||||
| 	"github.com/jtagcat/util" | ||||
| 	"github.com/jtagcat/util/batch" | ||||
| 	"github.com/jtagcat/util/retry" | ||||
| 	"go.mongodb.org/mongo-driver/mongo" | ||||
| 	"go.mongodb.org/mongo-driver/mongo/options" | ||||
| 	"k8s.io/apimachinery/pkg/util/wait" | ||||
| @@ -56,7 +57,7 @@ func (queue Queue) Sender(db *mongo.Collection, metricsFilename string, cancelOn | ||||
| 			} | ||||
| 		}() | ||||
|  | ||||
| 		util.Batch(MaxBatchItems, MaxBatchTime, queue, batched) | ||||
| 		batch.Batch(MaxBatchItems, MaxBatchTime, queue, batched) | ||||
| 		// returns when sendQueue is closed | ||||
| 	}() | ||||
|  | ||||
| @@ -71,7 +72,7 @@ func (queue Queue) Sender(db *mongo.Collection, metricsFilename string, cancelOn | ||||
|  | ||||
| 		promShipperSynced.WithLabelValues(metricsFilename).Set(0) | ||||
|  | ||||
| 		err := util.RetryOnError(backoff(), func() (_ bool, _ error) { | ||||
| 		err := retry.OnError(backoff(), func() (_ bool, _ error) { | ||||
| 			result, err := insertManyWithSimulate(db, batch) | ||||
|  | ||||
| 			var succeedCount int | ||||
|   | ||||
		Reference in New Issue
	
	Block a user