Commit f6daea48 authored by Onkar Sutar's avatar Onkar Sutar
Browse files

Added query string in source path to burst cache

parent 6d34402b
Branches
1 merge request!41Added query string in source path to burst cache
Showing with 7 additions and 0 deletions
......@@ -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")
......
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