Refactor and Cleanup

Add SecurityCheck
This commit is contained in:
2023-06-22 06:26:19 +02:00
parent bb7c1005c9
commit feba722a53
3 changed files with 8 additions and 18 deletions

View File

@@ -293,12 +293,18 @@ func (r *JobRepository) FindById(jobId int64) (*schema.Job, error) {
}
func (r *JobRepository) FindConcurrentJobs(
ctx context.Context,
job *schema.Job) (*model.JobLinkResultList, error) {
if job == nil {
return nil, nil
}
query := sq.Select("job.id", "job.job_id").From("job").Where("cluster = ?", job.Cluster)
query, qerr := SecurityCheck(ctx, sq.Select("job.id", "job.job_id").From("job"))
if qerr != nil {
return nil, qerr
}
query = query.Where("cluster = ?", job.Cluster)
var startTime int64
var stopTime int64