Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MKCLOS
Core Development Platform
corepkgv2
Merge requests
!111
Timeout added in downloadhelper.mdl
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Timeout added in downloadhelper.mdl
kunalt_downloadManager
into
devbranch
Overview
0
Commits
3
Pipelines
0
Changes
1
Merged
Kunal Taitkar
requested to merge
kunalt_downloadManager
into
devbranch
5 years ago
Overview
0
Commits
3
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
devbranch
version 1
68472fcf
5 years ago
devbranch (base)
and
latest version
latest version
145d1cee
3 commits,
5 years ago
version 1
68472fcf
2 commits,
5 years ago
1 file
+
13
−
1
Expand all files
Preferences
File browser
List view
Tree view
Compare changes
Inline
Side-by-side
Show whitespace changes
Show one file at a time
downloadhelpermdl/downloadhelpermdl.go
+
13
−
1
Options
@@ -52,6 +52,7 @@ type DownloadParameter struct {
jwtToken
string
isCacheBurst
bool
fileHashedValue
string
requestTimeOut
int64
DownloadError
error
}
@@ -82,6 +83,11 @@ func (dh *DownloadHelper) AddParamsCacheBurst(isCacheBurst bool) *DownloadHelper
return
dh
}
func
(
dh
*
DownloadHelper
)
AddRequestTimeout
(
requestTimeOutValue
int64
)
*
DownloadHelper
{
dh
.
DownloadParam
.
requestTimeOut
=
requestTimeOutValue
return
dh
}
// Run all Steps one by one
func
(
dh
*
DownloadHelper
)
Run
()
*
DownloadHelper
{
_
,
dh
.
DownloadParam
.
DownloadError
=
DownloadFile
(
dh
)
@@ -182,8 +188,14 @@ func downloadFileFromCloud(params *DownloadHelper) error {
defer
out
.
Close
()
//TODO: Code might be refactor (in case provision is given in httpmdl)
if
params
.
DownloadParam
.
requestTimeOut
<=
0
{
params
.
DownloadParam
.
requestTimeOut
=
0
}
// Fetching data from httpClient
client
:=
&
http
.
Client
{}
client
:=
&
http
.
Client
{
Timeout
:
time
.
Duration
(
params
.
DownloadParam
.
requestTimeOut
)
*
time
.
Second
,
}
// Call to fetch content
req
,
err
:=
http
.
NewRequest
(
"GET"
,
params
.
sourceURL
,
nil
)
Menu
Explore
Projects
Groups
Topics
Snippets