update
This commit is contained in:
@@ -56,8 +56,8 @@ struct msgPayload_v1
|
||||
end
|
||||
|
||||
# constructor
|
||||
function msgPayload_v1(
|
||||
id::String = "";
|
||||
function msgPayload_v1(;
|
||||
id::String = "",
|
||||
dataname::String = "",
|
||||
type::String = "text",
|
||||
transport::String = "direct",
|
||||
@@ -100,8 +100,8 @@ struct msgEnvelope_v1
|
||||
end
|
||||
|
||||
# constructor
|
||||
function msgEnvelope_v1(
|
||||
correlationId::String = "";
|
||||
function msgEnvelope_v1(;
|
||||
correlationId::String = "",
|
||||
msgId::String = "",
|
||||
timestamp::String = "",
|
||||
sendTo::String = "",
|
||||
@@ -547,7 +547,7 @@ payloads = smartreceive(msg, fileserverDownloadHandler, max_retries, base_delay,
|
||||
"""
|
||||
function smartreceive(
|
||||
msg::NATS.Message,
|
||||
fileserverDownloadHandler::Function;
|
||||
fileserverDownloadHandler::Function=_fetch_with_backoff;
|
||||
max_retries::Int = 5,
|
||||
base_delay::Int = 100,
|
||||
max_delay::Int = 5000
|
||||
@@ -588,8 +588,8 @@ function smartreceive(
|
||||
# Extract URL from the payload
|
||||
url = String(payload_data["data"])
|
||||
|
||||
# Fetch with exponential backoff using the download handler
|
||||
downloaded_data = fileserverDownloadHandler(DEFAULT_FILESERVER_URL, url, max_retries, base_delay, max_delay)
|
||||
#[WORKING] Fetch with exponential backoff using the download handler
|
||||
downloaded_data = fileserverDownloadHandler(json_data["data"], max_retries, base_delay, max_delay,json_data["correlationId"])
|
||||
|
||||
# Deserialize based on type
|
||||
data_type = String(payload_data["type"])
|
||||
@@ -851,4 +851,22 @@ function plik_oneshot_upload(fileServerURL::String, filepath::String)
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
end # module
|
||||
|
||||
Reference in New Issue
Block a user