func (s *StateStore) UpsertEvals(index uint64, evals []*structs.Evaluation) error {
	txn := s.db.Txn(true)
	defer txn.Abort()

	// Do a nested upsert
	jobs := make(map[string]string, len(evals))
	for _, eval := range evals {
		if err := s.nestedUpsertEval(txn, index, eval); err != nil {
			return err
		}

		jobs[eval.JobID] = ""
	}

	// Set the job's status
	if err := s.setJobStatuses(index, txn, jobs, false); err != nil {
		return fmt.Errorf("setting job status failed: %v", err)
	}

	txn.Commit()
	return nil
}
// UpsertEvals is used to upsert a set of evaluations
UpsertEvals is used to upsert a set of evaluations
// UpsertEvals is used to upsert a set of evaluations
func (s *StateStore) UpsertEvals(index uint64, evals []*structs.Evaluation) error {
	txn := s.db.Txn(true)
	defer txn.Abort()
	jobs := make(map[string]string, len(evals))
	for _, eval := range evals {
		if err := s.nestedUpsertEval(txn, index, eval); err != nil {
			return err
		}
		jobs[eval.JobID] = ""
	}
	if err := s.setJobStatuses(index, txn, jobs, false); err != nil {
		return fmt.Errorf("setting job status failed: %v", err)
	}
	txn.Commit()
	return nil
}
func ( s * StateStore ) UpsertEvals ( index uint64 , evals [ ] * structs . Evaluation ) error { txn := s . db . Txn ( true ) defer txn . Abort ( ) jobs := make ( map [ string ] string , len ( evals ) ) for _ , eval := range evals { if err := s . nestedUpsertEval ( txn , index , eval ) ; err != nil { return err } jobs [ eval . JobID ] = " " } if err := s . setJobStatuses ( index , txn , jobs , false ) ; err != nil { return fmt . Errorf ( " " , err ) } txn . Commit ( ) return nil }
UpsertEvals is used to upsert a set of evaluations
UpsertEvals is used to upsert a set of evaluations
// Do a nested upsert // Set the job's status