func (s *StateStore) JobByID(ws memdb.WatchSet, id string) (*structs.Job, error) {
	txn := s.db.Txn(false)

	watchCh, existing, err := txn.FirstWatch("jobs", "id", id)
	if err != nil {
		return nil, fmt.Errorf("job lookup failed: %v", err)
	}
	ws.Add(watchCh)

	if existing != nil {
		return existing.(*structs.Job), nil
	}
	return nil, nil
}
// JobByID is used to lookup a job by its ID. JobByID returns the current/latest job
// version.
JobByID is used to lookup a job by its ID. JobByID returns the current/latest job
version.
// JobByID is used to lookup a job by its ID . JobByID returns the current / latest job // version .
func (s *StateStore) JobByID(ws memdb.WatchSet, id string) (*structs.Job, error) {
	txn := s.db.Txn(false)
	watchCh, existing, err := txn.FirstWatch("jobs", "id", id)
	if err != nil {
		return nil, fmt.Errorf("job lookup failed: %v", err)
	}
	ws.Add(watchCh)
	if existing != nil {
		return existing.(*structs.Job), nil
	}
	return nil, nil
}
func ( s * StateStore ) JobByID ( ws memdb . WatchSet , id string ) ( * structs . Job , error ) { txn := s . db . Txn ( false ) watchCh , existing , err := txn . FirstWatch ( " " , " " , id ) if err != nil { return nil , fmt . Errorf ( " " , err ) } ws . Add ( watchCh ) if existing != nil { return existing . ( * structs . Job ) , nil } return nil , nil }
JobByID is used to lookup a job by its ID.
JobByID is used to lookup a job by its ID .