fix batch buffer size check

Signed-off-by: c9s <yoanlin93@gmail.com>
This commit is contained in:
c9s 2022-06-19 17:36:28 +08:00
parent 6b26d5a956
commit bf0186cf55
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -130,7 +130,7 @@ func (sel SyncTask) execute(ctx context.Context, db *sqlx.DB, startTime time.Tim
}
if sel.BatchInsert != nil {
if batchBufferRefVal.Len() >= sel.BatchInsertBuffer-1 {
if batchBufferRefVal.Len() > sel.BatchInsertBuffer-1 {
if sel.LogInsert {
logrus.Infof("batch inserting %d %T", batchBufferRefVal.Len(), obj)
} else {