diff --git a/iniDataForLinux b/iniDataForLinux index b4d4a32..6dfebff 100755 Binary files a/iniDataForLinux and b/iniDataForLinux differ diff --git a/iniDataForMacOs b/iniDataForMacOs index c3055d0..394c234 100755 Binary files a/iniDataForMacOs and b/iniDataForMacOs differ diff --git a/main.go b/main.go index b2cca76..fd6ea2f 100644 --- a/main.go +++ b/main.go @@ -464,7 +464,7 @@ func batchInsert(fileName string, isLastCall bool, excludedFilename string) int dataFileName = fmt.Sprintf("lastCall-%s", excludedFilename) } else { batchName = fmt.Sprintf("%s-%s", record[1], record[0]) - dataFileName = fileName + dataFileName = fileName[:len(fileName)-10] } batchParams := BatchParams{ @@ -646,6 +646,7 @@ func batchDataInsert(fileName string, lastCallKeys map[string]bool, excludedFile Order("b1.created_at desc"). Find(&batches) dataFileName = strings.Replace(fileName, "targets", "definition", -1) + dataFileName = dataFileName[:len(dataFileName)-10] } batchCount := len(batches) @@ -680,7 +681,6 @@ func batchDataInsert(fileName string, lastCallKeys map[string]bool, excludedFile "ReservedField3": row[7], "ReservedField4": row[8], "ReservedField5": row[9], - "DataFileName": dataFileName, "FullName": row[4], } reservedFieldsJson, err := json.Marshal(reservedFields) //个性化字段转json @@ -729,6 +729,7 @@ func batchDataInsert(fileName string, lastCallKeys map[string]bool, excludedFile CommunicationChannelID: row[2], Mobile: row[3], ReservedField: string(reservedFieldsJson), + DataFileName: dataFileName, }) if len(dataBatch) >= batchSize { @@ -989,7 +990,7 @@ func iniConfi() { txtPath = "RawData/Txt/" logPath = "logs/" batchSize = 5000 //提交数据 - insertSize = 660 //一次性入库 + insertSize = 500 //一次性入库 insertChanSize = 10 //通道缓冲数 goSize = 10 //协程数 taskTime = 1 @@ -1015,7 +1016,7 @@ func iniConfi() { txtPath = "RawData/Txt/" logPath = "logs/" batchSize = 5000 //提交数据 - insertSize = 660 //一次性入库 + insertSize = 500 //一次性入库 insertChanSize = 100 //通道缓冲数 goSize = 50 //协程数 taskTime = 60 @@ -1129,6 +1130,7 @@ type BatcheData struct { CommunicationChannelID string `gorm:"column:communication_channel_id"` Mobile string `gorm:"column:mobile"` ReservedField string `gorm:"column:reserved_field"` + DataFileName string `gorm:"column:data_file_name"` } func (BatcheData) TableName() string { @@ -1153,6 +1155,7 @@ type BatchDataDuplicateLog struct { CommunicationChannelID string `gorm:"column:communication_channel_id"` Mobile string `gorm:"column:mobile"` ReservedField string `gorm:"column:reserved_field"` + DataFileName string `gorm:"column:data_file_name"` } func (BatchDataDuplicateLog) TableName() string {