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
coreospackage
Commits
f6daea48
Commit
f6daea48
authored
7 years ago
by
Onkar Sutar
Browse files
Options
Downloads
Patches
Plain Diff
Added query string in source path to burst cache
parent
6d34402b
Branches
Branches containing commit
1 merge request
!41
Added query string in source path to burst cache
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
downloadhelper/downloadHelper.go
+7
-0
downloadhelper/downloadHelper.go
with
7 additions
and
0 deletions
downloadhelper/downloadHelper.go
+
7
−
0
View file @
f6daea48
...
...
@@ -4,6 +4,7 @@ import (
"errors"
"path"
"path/filepath"
"strconv"
"strings"
"time"
...
...
@@ -30,6 +31,12 @@ func DownloadFile(sourcePath, destinationPath, jwtToken string, retryCnt int) (b
logginghelper
.
LogDebug
(
"IN : DownloadFile"
)
destinationPath
=
filehelper
.
CleanPath
(
destinationPath
)
logginghelper
.
LogDebug
(
"DownloadFile : Downloding "
,
sourcePath
,
" at "
,
destinationPath
)
mkclCacheBurst
:=
strconv
.
FormatInt
(
time
.
Now
()
.
UnixNano
(),
10
)
if
strings
.
Contains
(
sourcePath
,
"?"
)
{
sourcePath
=
sourcePath
+
"&&mkclCacheBurst="
+
mkclCacheBurst
}
else
{
sourcePath
=
sourcePath
+
"?mkclCacheBurst="
+
mkclCacheBurst
}
if
strings
.
Trim
(
sourcePath
,
EMPTY_STR
)
==
EMPTY_STR
||
strings
.
Trim
(
destinationPath
,
EMPTY_STR
)
==
EMPTY_STR
||
!
strings
.
HasPrefix
(
sourcePath
,
HTTP_PROTOCOL
)
{
logginghelper
.
LogDebug
(
"DownloadFile : sourcePath is empty"
)
logginghelper
.
LogDebug
(
"OUT : DownloadFile"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets