production runtime and mock removal
This commit is contained in:
1 parent
2ef3da7af5
commit
6480e503eb
55 files changed
+581
-540
No files matched your search
@@ -217,7 +217,6 @@ func writeOutputState(ctx context.Context, state JobStateWriter, job jobs.Job, i
|
||||
type GeneratedAssetImporter interface {
|
||||
List(context.Context, assets.Scope) ([]assets.Asset, error)
|
||||
ImportGenerated(context.Context, assets.Scope, assets.ImportGeneratedCommand) (assets.Asset, error)
|
||||
ImportMock(context.Context, assets.Scope, assets.ImportMockCommand) (assets.Asset, error)
|
||||
}
|
||||
|
||||
type OutputURLResolver func(jobs.Job) ([]string, error)
|
||||
@@ -240,24 +239,6 @@ func (r *AssetOutputRegistrar) Register(ctx context.Context, job jobs.Job) ([]st
|
||||
if err != nil {
|
||||
return nil, errors.New("register generation outputs")
|
||||
}
|
||||
if job.Provider == "mock" {
|
||||
if id := existingOutputID(existing, job.ID, "output:0"); id != "" {
|
||||
return []string{id}, nil
|
||||
}
|
||||
kind := assets.KindImage
|
||||
if job.Capability == "video.generate" {
|
||||
kind = assets.KindVideo
|
||||
}
|
||||
created, createErr := r.assets.ImportMock(ctx, scope, assets.ImportMockCommand{
|
||||
Capability: job.Capability, JobID: job.ID, Kind: kind,
|
||||
Tags: []string{"generated", job.Capability, "job:" + job.ID, "output:0"},
|
||||
Metadata: map[string]any{"capability": job.Capability, "jobId": job.ID, "index": 0},
|
||||
})
|
||||
if createErr != nil {
|
||||
return nil, errors.New("register generation outputs")
|
||||
}
|
||||
return []string{created.ID}, nil
|
||||
}
|
||||
urls, err := r.resolve(job)
|
||||
if err != nil || len(urls) == 0 {
|
||||
return nil, errors.New("register generation outputs")
|
||||
|
||||
Reference in new issue
Block a user