diff --git a/internal/manager/api_impl/api_impl.go b/internal/manager/api_impl/api_impl.go index 9c4aa73a..81f0db3d 100644 --- a/internal/manager/api_impl/api_impl.go +++ b/internal/manager/api_impl/api_impl.go @@ -38,6 +38,7 @@ var _ api.ServerInterface = (*Flamenco)(nil) type PersistenceService interface { StoreAuthoredJob(ctx context.Context, authoredJob job_compilers.AuthoredJob) error + // FetchJob fetches a single job, without fetching its tasks. FetchJob(ctx context.Context, jobID string) (*persistence.Job, error) // FetchTask fetches the given task and the accompanying job. FetchTask(ctx context.Context, taskID string) (*persistence.Task, error) diff --git a/internal/manager/persistence/jobs.go b/internal/manager/persistence/jobs.go index bba341b3..4b1972a7 100644 --- a/internal/manager/persistence/jobs.go +++ b/internal/manager/persistence/jobs.go @@ -169,6 +169,7 @@ func (db *DB) StoreAuthoredJob(ctx context.Context, authoredJob job_compilers.Au }) } +// FetchJob fetches a single job, without fetching its tasks. func (db *DB) FetchJob(ctx context.Context, jobUUID string) (*Job, error) { dbJob := Job{} findResult := db.gormDB.WithContext(ctx).First(&dbJob, "uuid = ?", jobUUID)