feat(11-01): run job workers in serve and queue:work, add queue:clear
- Manager gains the apparatus JobManager surface: StartJob, UpdateJobState, UpdateMetadata, FailJob, CancelJob (is_canceled + STOPPED + River JobCancel), StopJob (STOPPED only), CheckIfCanceled and GetMetadata, all raw column writes so updated_at is untouched - serve starts the in-process worker unless queue.work_in_serve is false and stops it on shutdown; an app without jobs gets an idle worker - queue:work runs a foreground worker with repeatable --queue filters; queue:clear deletes available, scheduled and retryable jobs of one queue - the generated main appends conga.RuntimeCommands; summer delegates queue:work and queue:clear; make:job scaffolds a conga.Job
This commit is contained in:
@@ -192,7 +192,8 @@ func MakeCommand(ctx context.Context, startDir, pluginID, name string) (Artifact
|
||||
return ArtifactResult{PluginDir: plugin.Dir, Files: []string{path}, Hint: plugin.Hint}, nil
|
||||
}
|
||||
|
||||
// MakeJob writes a pact.Job stub without importing River.
|
||||
// MakeJob writes a typed job wrapped in conga.Job; the plugin never
|
||||
// imports River.
|
||||
func MakeJob(ctx context.Context, startDir, pluginID, name string) (ArtifactResult, error) {
|
||||
plugin, err := resolvePlugin(startDir, pluginID)
|
||||
if err != nil {
|
||||
@@ -210,10 +211,9 @@ func MakeJob(ctx context.Context, startDir, pluginID, name string) (ArtifactResu
|
||||
return ArtifactResult{}, err
|
||||
}
|
||||
src, err := renderStub("job.go", artifactData{
|
||||
Ident: name,
|
||||
Func: fn,
|
||||
Worker: unexportedIdent(name) + "Job",
|
||||
Kind: plugin.ID + "." + toSnake(name),
|
||||
Ident: name,
|
||||
Func: fn,
|
||||
Kind: plugin.ID + "." + toSnake(name),
|
||||
})
|
||||
if err != nil {
|
||||
return ArtifactResult{}, err
|
||||
|
||||
Reference in New Issue
Block a user