Remove obsolete check

Now handeled by DB UNIQUE constraint
This commit is contained in:
Jan Eitzinger 2023-05-04 18:14:46 +02:00
parent 7491ae9e3c
commit f6c629c696

View File

@ -6,7 +6,6 @@ package importer
import ( import (
"bytes" "bytes"
"database/sql"
"encoding/json" "encoding/json"
"fmt" "fmt"
"os" "os"
@ -69,17 +68,18 @@ func HandleImportFlag(flag string) error {
} }
// checkJobData(&jobData) // checkJobData(&jobData)
// SanityChecks(&jobMeta.BaseJob)
jobMeta.MonitoringStatus = schema.MonitoringStatusArchivingSuccessful jobMeta.MonitoringStatus = schema.MonitoringStatusArchivingSuccessful
if _, err = r.Find(&jobMeta.JobID, &jobMeta.Cluster, &jobMeta.StartTime); err != sql.ErrNoRows {
if err != nil {
log.Warn("Error while finding job in jobRepository")
return err
}
return fmt.Errorf("REPOSITORY/INIT > a job with that jobId, cluster and startTime does already exist")
}
// if _, err = r.Find(&jobMeta.JobID, &jobMeta.Cluster, &jobMeta.StartTime); err != sql.ErrNoRows {
// if err != nil {
// log.Warn("Error while finding job in jobRepository")
// return err
// }
//
// return fmt.Errorf("REPOSITORY/INIT > a job with that jobId, cluster and startTime does already exist")
// }
//
job := schema.Job{ job := schema.Job{
BaseJob: jobMeta.BaseJob, BaseJob: jobMeta.BaseJob,
StartTime: time.Unix(jobMeta.StartTime, 0), StartTime: time.Unix(jobMeta.StartTime, 0),