feat(14-02): conga.Describe reports a registered job's kind, queue, attempts and timeout
- lets a plugin test assert what its Jobs() registers, such as the CSV match job's 240 s timeout, without reaching into conga internals - README API table, jobs docs page and an example
This commit is contained in:
@@ -174,3 +174,11 @@ func TestDocsDispatch(t *testing.T) {
|
||||
time.Sleep(25 * time.Millisecond)
|
||||
}
|
||||
}
|
||||
|
||||
func ExampleDescribe() {
|
||||
job := conga.Job(func(ctx context.Context, args ImportPostsArgs) error { return nil },
|
||||
conga.OnQueue("imports"), conga.Timeout(4*time.Minute))
|
||||
info, ok := conga.Describe(job)
|
||||
fmt.Println(ok, info.Kind, info.Queue, info.MaxAttempts, info.Timeout)
|
||||
// Output: true acme_blog_import_posts imports 0 4m0s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user