Skip to content

Commit

Permalink
Temp remove try-catch wrap of track API call for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill-Becker committed Feb 3, 2025
1 parent b1f3159 commit dc2b21a
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions src/core/reopt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -591,31 +591,31 @@ function run_reopt(m::JuMP.AbstractModel, p::REoptInputs; organize_pvs=true)
results["Messages"] = logger_to_dict()

if p.s.settings.track && !(typeof(p.s) <: BAUScenario)
try
track_data = Dict(
"run_data" => Dict(
"name" => p.s.settings.name,
"latitude" => p.s.site.latitude,
"longitude" => p.s.site.longitude,
"country" => "",
"city" => "",
"pv_size" => get(get(results, "PV", Dict()), "size_kw", nothing),
"battery_energy_size" => get(get(results, "ElectricStorage", Dict()), "size_kwh", nothing),
"battery_power_size" => get(get(results, "ElectricStorage", Dict()), "size_kw", nothing)
),
"webtool_run" => p.s.settings.webtool_run,
"api_run_uuid" => p.s.settings.api_run_uuid,
"webtool_user_uuid" => p.s.settings.webtool_user_uuid,
"reoptjl_version" => p.s.settings.reoptjl_version,
"status" => results["status"]
)

headers = Dict("Content-Type" => "application/json")
HTTP.post("http://localhost:7800/reopt/post/", headers, JSON.json(track_data))
catch #e
@warn "Could not post tracking data to REopt API"
#@info e.message
end
# try
track_data = Dict(
"run_data" => Dict(
"name" => p.s.settings.name,
"latitude" => p.s.site.latitude,
"longitude" => p.s.site.longitude,
"country" => "",
"city" => "",
"pv_size" => get(get(results, "PV", Dict()), "size_kw", nothing),
"battery_energy_size" => get(get(results, "ElectricStorage", Dict()), "size_kwh", nothing),
"battery_power_size" => get(get(results, "ElectricStorage", Dict()), "size_kw", nothing)
),
"webtool_run" => p.s.settings.webtool_run,
"api_run_uuid" => p.s.settings.api_run_uuid,
"webtool_user_uuid" => p.s.settings.webtool_user_uuid,
"reoptjl_version" => p.s.settings.reoptjl_version,
"status" => results["status"]
)

headers = Dict("Content-Type" => "application/json")
HTTP.post("http://localhost:7800/reopt/post/", headers, JSON.json(track_data))
# catch #e
# @warn "Could not post tracking data to REopt API"
# #@info e.message
# end
end

return results
Expand Down

0 comments on commit dc2b21a

Please sign in to comment.