Skip to content

Commit

Permalink
fixed regression in latest build
Browse files Browse the repository at this point in the history
  • Loading branch information
jpswinski committed Oct 23, 2024
1 parent 0335829 commit 81459d0
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions scripts/extensions/proxy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ local function proxy(resources, parms_tbl, endpoint, rec)
end
end

-- Populate Resources via CMR Request --
if not resources then
local rc, rsps = earthdata.cmr(parms_tbl)
if rc == earthdata.SUCCESS then
resources = rsps
userlog:alert(core.INFO, core.RTE_INFO, string.format("request <%s> retrieved %d resources from CMR", rspq, #resources))
else
userlog:alert(core.CRITICAL, core.RTE_SIMPLIFY, string.format("request <%s> failed to make CMR request <%d>: %s", rspq, rc, rsps))
return
end
end

-- Create Request Parameters --
local parms = core.parms(parms_tbl)

Expand Down Expand Up @@ -73,18 +85,6 @@ local function proxy(resources, parms_tbl, endpoint, rec)
-- Determine Locks per Node --
local locks_per_node = (parms["poly"] and not parms["ignore_poly_for_cmr"]) and 1 or core.MAX_LOCKS_PER_NODE

-- Populate Resources via CMR Request --
if not resources then
local rc, rsps = earthdata.cmr(parms)
if rc == earthdata.SUCCESS then
resources = rsps
userlog:alert(core.INFO, core.RTE_INFO, string.format("request <%s> retrieved %d resources from CMR", rspq, #resources))
else
userlog:alert(core.CRITICAL, core.RTE_SIMPLIFY, string.format("request <%s> failed to make CMR request <%d>: %s", rspq, rc, rsps))
return
end
end

-- Proxy Request --
local endpoint_proxy = core.proxy(endpoint, resources, json.encode(parms_tbl), node_timeout, locks_per_node, rsps_from_nodes, terminate_proxy_stream, cluster_size_hint)

Expand Down

0 comments on commit 81459d0

Please sign in to comment.