Commit e8dd26d9 authored by Ajit Jagtap's avatar Ajit Jagtap
Browse files

Merge branch 'DownloadHelper_CacheBurst' into 'master'

Added query string in source path to burst cache

See merge request !41
parents 6d34402b 08025bae
Branches
1 merge request!41Added query string in source path to burst cache
Showing with 8 additions and 1 deletion
......@@ -4,6 +4,7 @@ import (
"errors"
"path"
"path/filepath"
"strconv"
"strings"
"time"
......@@ -29,7 +30,13 @@ const (
func DownloadFile(sourcePath, destinationPath, jwtToken string, retryCnt int) (bool, error) {
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
}
logginghelper.LogDebug("DownloadFile : Downloading ", sourcePath, " at ", destinationPath)
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")
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment