Skip to content

Commit 174ba55

Browse files
committed
moved call to fetch plugin inside lambda
1 parent f7a3207 commit 174ba55

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

internal/plugin/git.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,19 @@ func (p *gitPlugin) FileContent(subpath string) ([]byte, error) {
157157
return nil, err
158158
}
159159

160-
var bytes []byte
160+
process := func() ([]byte, time.Duration, error) {
161+
var bytes []byte
161162

162-
if p.ref.Type == flake.TypeSSH {
163-
bytes, err = p.fetchSSHArchive(location)
164-
} else {
165-
bytes, err = p.fetchHttp(location)
166-
}
163+
if p.ref.Type == flake.TypeSSH {
164+
bytes, err = p.fetchSSHArchive(location)
165+
} else {
166+
bytes, err = p.fetchHttp(location)
167+
}
167168

168-
if err != nil {
169-
return nil, err
170-
}
169+
if err != nil {
170+
return nil, 0, err
171+
}
171172

172-
process := func() ([]byte, time.Duration, error) {
173173
// Cache for 24 hours. Once we store the plugin in the lockfile, we
174174
// should cache this indefinitely and only invalidate if the plugin
175175
// is updated.

0 commit comments

Comments
 (0)