Skip to content

Commit fd132ec

Browse files
longTimeout and isUpload
1 parent d6e27d2 commit fd132ec

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

elabftw_client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func (a *App) loadElabftwClientConfig(profileUUID string, instanceID int64) (*el
9898
return &cfg, nil
9999
}
100100

101-
func elabftwHTTPClient(verifyTLS bool, upload bool) *http.Client {
101+
func elabftwHTTPClient(verifyTLS bool, longTimeout bool) *http.Client {
102102
transport := &http.Transport{
103103
TLSClientConfig: &tls.Config{
104104
// Only false when the user explicitly disables TLS verification.
@@ -111,7 +111,7 @@ func elabftwHTTPClient(verifyTLS bool, upload bool) *http.Client {
111111
// request, including sending the file, which may take several minutes on
112112
// slower connections
113113
timeout := 30 * time.Second // 30 sec
114-
if upload {
114+
if longTimeout {
115115
timeout = 10 * time.Minute // 10 mins
116116
}
117117
return &http.Client{
@@ -126,7 +126,7 @@ func (a *App) elabftwRequest(
126126
method string,
127127
path string,
128128
body io.Reader,
129-
upload bool,
129+
isUpload bool,
130130
headers ...map[string]string,
131131
) (*http.Response, error) {
132132
cfg, err := a.loadElabftwClientConfig(profileUUID, instanceID)
@@ -152,7 +152,7 @@ func (a *App) elabftwRequest(
152152
}
153153
}
154154

155-
client := elabftwHTTPClient(cfg.VerifyTLS, upload)
155+
client := elabftwHTTPClient(cfg.VerifyTLS, isUpload)
156156

157157
resp, err := client.Do(req)
158158
if err != nil {

0 commit comments

Comments
 (0)