File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ toolchain go1.23.6
66
77// Deploymenttheory
88require (
9- github.com/deploymenttheory/go-api-http-client v0.3 .0
9+ github.com/deploymenttheory/go-api-http-client v0.4 .0
1010 github.com/deploymenttheory/go-api-http-client-integrations v0.0.13
1111)
1212
Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ github.com/aws/smithy-go v1.22.2 h1:6D9hW43xKFrRx/tXXfAlIZc4JI+yQe6snnWcQyxSyLQ=
4242github.com/aws/smithy-go v1.22.2 /go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg =
4343github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c =
4444github.com/davecgh/go-spew v1.1.1 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
45- github.com/deploymenttheory/go-api-http-client v0.3 .0 h1:ld71pjbdLktvC9UfS2QFVpnQccJnjguOg/S2UXohBB4 =
46- github.com/deploymenttheory/go-api-http-client v0.3 .0 /go.mod h1:wJIFm4S1jj4io+G3E3pxyhmHQXXiZ5ft0xZxorsWOSo =
45+ github.com/deploymenttheory/go-api-http-client v0.4 .0 h1:YSgt8Gx3LzmSh5Pjt7zJ6ilAuTCmsy9Wzo2V4NajXmw =
46+ github.com/deploymenttheory/go-api-http-client v0.4 .0 /go.mod h1:wJIFm4S1jj4io+G3E3pxyhmHQXXiZ5ft0xZxorsWOSo =
4747github.com/deploymenttheory/go-api-http-client-integrations v0.0.13 h1:zqGfWtdtRpYaCcsje2//Hpha1eSO0vblbSVvRr8ax7k =
4848github.com/deploymenttheory/go-api-http-client-integrations v0.0.13 /go.mod h1:m9XNzP2pNsw8eg+Bdqjrnmn/QK1vrGsDDboabc//IdQ =
4949github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE =
Original file line number Diff line number Diff line change @@ -10,10 +10,12 @@ import (
1010 "fmt"
1111 "net/http"
1212 "net/url"
13+ "time"
1314)
1415
1516// URI for Packages in the Jamf Pro Classic API
1617const uriPackages = "/api/v1/packages"
18+ const packagesHttpTimeout = 10 * time .Minute
1719
1820// ResponsePackagesList struct to capture the JSON response for packages list
1921type ResponsePackagesList struct {
@@ -274,6 +276,9 @@ func (c *Client) CreatePackage(packageMetadata ResourcePackage) (*ResponsePackag
274276func (c * Client ) UploadPackage (id string , filePaths []string ) (* ResponsePackageCreatedAndUpdated , error ) {
275277 endpoint := fmt .Sprintf ("%s/%s/upload" , uriPackages , id )
276278
279+ c .HTTP .ModifyHttpTimeout (packagesHttpTimeout )
280+ defer c .HTTP .ResetTimeout ()
281+
277282 // Create a map for the files to be uploaded
278283 files := map [string ][]string {
279284 "file" : filePaths ,
You can’t perform that action at this time.
0 commit comments