MCPcopy
hub / github.com/iron-io/functions / getTask

Function getTask

api/runner/async_runner.go:22–43  ·  view source on GitHub ↗
(ctx context.Context, url string)

Source from the content-addressed store, hash-verified

20)
21
22func getTask(ctx context.Context, url string) (*models.Task, error) {
23 resp, err := http.Get(url)
24 if err != nil {
25 return nil, err
26 }
27
28 body, err := ioutil.ReadAll(resp.Body)
29 if err != nil {
30 return nil, err
31 }
32
33 var task models.Task
34
35 if err := json.Unmarshal(body, &task); err != nil {
36 return nil, err
37 }
38
39 if task.ID == "" {
40 return nil, nil
41 }
42 return &task, nil
43}
44
45func getCfg(t *models.Task) *task.Config {
46 timeout := int32(30)

Callers 4

TestGetTaskFunction · 0.85
TestGetTaskErrorFunction · 0.85
TestDeleteTaskFunction · 0.85
startAsyncRunnersFunction · 0.85

Calls 1

GetMethod · 0.65

Tested by 3

TestGetTaskFunction · 0.68
TestGetTaskErrorFunction · 0.68
TestDeleteTaskFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…