From 7b0a693a5bafe29ce193776987375fbeaad55be7 Mon Sep 17 00:00:00 2001 From: Jacques Vella Critien <30493486+jacquesvcritien@users.noreply.github.com> Date: Thu, 5 May 2022 21:14:06 +0200 Subject: [PATCH 1/3] Removing the use of the relation Removing the use of the relation because the agoric_subscriptions table is empty and not being used. This is causing issues when restarting the initiator and it tries to load records. --- store/database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/database.go b/store/database.go index 9cd0d249..5feb18a5 100644 --- a/store/database.go +++ b/store/database.go @@ -158,7 +158,7 @@ func (client Client) prepareSubscription(rawSub *Subscription) (*Subscription, e return nil, err } case "agoric": - if err := client.db.Model(&sub).Related(&sub.Agoric).Error; err != nil { + if err := client.db.Model(&sub).Error; err != nil { return nil, err } } From 3952b68b1cc341d4cf0adf18f82d0d51b88f42fe Mon Sep 17 00:00:00 2001 From: Jacques Vella Critien <30493486+jacquesvcritien@users.noreply.github.com> Date: Thu, 5 May 2022 21:17:12 +0200 Subject: [PATCH 2/3] Updated path in sendJobrunTrigger Updated path in sendJobrunTrigger() to /v2/jobs//runs to match Chainlink V2 Jobs --- chainlink/node.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chainlink/node.go b/chainlink/node.go index 581f4249..97782f72 100644 --- a/chainlink/node.go +++ b/chainlink/node.go @@ -69,7 +69,7 @@ func (cl Node) TriggerJob(jobId string, data []byte) error { func (cl Node) sendJobrunTrigger(jobId string, data []byte) error { u := cl.Endpoint - u.Path = fmt.Sprintf("/v2/specs/%s/runs", jobId) + u.Path = fmt.Sprintf("/v2/jobs/%s/runs", jobId) request, err := http.NewRequest(http.MethodPost, u.String(), bytes.NewReader(data)) if err != nil { From 0433f8040a8331ac5d82afd46163ce55387a46c0 Mon Sep 17 00:00:00 2001 From: Jacques Vella Critien <30493486+jacquesvcritien@users.noreply.github.com> Date: Thu, 5 May 2022 21:17:34 +0200 Subject: [PATCH 3/3] Fixed paths in tests --- chainlink/node_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chainlink/node_test.go b/chainlink/node_test.go index 4a1030d6..52ba492a 100644 --- a/chainlink/node_test.go +++ b/chainlink/node_test.go @@ -44,7 +44,7 @@ func TestMain(m *testing.M) { return } - if r.URL.Path == fmt.Sprintf("/v2/specs/%s/runs", jobIdWPayload) { + if r.URL.Path == fmt.Sprintf("/v2/jobs/%s/runs", jobIdWPayload) { body, err := ioutil.ReadAll(r.Body) if err != nil { w.WriteHeader(http.StatusInternalServerError) @@ -55,7 +55,7 @@ func TestMain(m *testing.M) { w.WriteHeader(http.StatusBadRequest) return } - } else if r.URL.Path != fmt.Sprintf("/v2/specs/%s/runs", jobId) { + } else if r.URL.Path != fmt.Sprintf("/v2/jobs/%s/runs", jobId) { w.WriteHeader(http.StatusNotFound) return }