Cleanup: Manager, add bit of documentation

This commit is contained in:
Sybren A. Stüvel 2022-05-03 10:39:44 +02:00
parent 9b330280b7
commit bb68488c5e
2 changed files with 2 additions and 0 deletions

View File

@ -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)

View File

@ -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)